2018年12月18日 星期二
Keil C: Warning: #1296-D: extended constant initialiser used"?
The root cause is miss use a pointer to a static variable like:
int x = 1;
int y = (int) &x;
Modify version
int x = 1;
int *y = &x;
printf("%p\n", &x); // memory address of x
printf("%p\n", &y); // memory address of y
printf("%p\n", y); // y = memory address of x
printf("%d\n", *y); // *y = memory content of x = 1
Addresses are not arithmetic types in ANSI C spec, so if need to get the address of a static variable, use a pointer point to the variable's address.
Ref :
1. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15182.html
2.https://openhome.cc/Gossip/CGossip/Pointer.html
訂閱:
張貼留言 (Atom)
Linux driver: How to enable dynamic debug at booting time for built-in driver.
Dynamic debug is useful for debug driver, and can be enable by: 1. Mount debug fs #>mount -t debugfs none /sys/kernel/debug 2. Enable dy...
-
The root cause is miss use a pointer to a static variable like: int x = 1; int y = (int) &x; Modify version int x = 1; int *y =...
-
1.Create the project folder and win_gui_v1.go in your go work space > cd ..\src\ > mkdir win_gui_v1 2.Copy the .manifest file...
-
1.Download Astyle http://astyle.sourceforge.net/ 2. Open Keil -> Tool -> Customize Tool Menu config as below My argument. Can ...
沒有留言:
張貼留言