Error Macro Names Must Be Identifiers Linux
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or error macro names must be identifiers in c posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss macro names must be identifiers arduino Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only
Macro Names Must Be Identifiers #define
0 ... #endif And I get this error error: macro names must be identifiers Why is this happening? c++ macros c-preprocessor share|improve this question edited Nov 27 '15 at 11:33 Brian Tompsett - 汤莱恩 3,093132775 asked Jan 9 '09 at 1:27 Eduardo 4,220164567 I think you misremembered; #ifdef 0 is an error in C as well as C++. –Jonathan Leffler Jan 9 '09 at 2:25 2 You are right I misrembered, It does not work in C, I macro name must be an identifier xcode am not going to delete the question because maybe someone in the future makes the same mistake. –Eduardo Jan 9 '09 at 5:36 @Eduardo Thanks for not deleting the question. –kartik Feb 24 '14 at 8:00 add a comment| 6 Answers 6 active oldest votes up vote 47 down vote accepted The #ifdef directive is used to check if a preprocessor symbol is defined. The standard (C11 6.4.2 Identifiers) mandates that identifiers must not start with a digit: identifier: identifier-nondigit identifier identifier-nondigit identifier digit identifier-nondigit: nondigit universal-character-name other implementation-defined characters> nondigit: one of _ a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z digit: one of 0 1 2 3 4 5 6 7 8 9 The correct form for using the pre-processor to block out code is: #if 0 : : : #endif You can also use: #ifdef NO_CHANCE_THAT_THIS_SYMBOL_WILL_EVER_EXIST : : : #endif but you need to be confident that the symbols will not be inadvertently set by code other than your own. In other words, don't use something like NOTUSED or DONOTCOMPILE which others may also use. To be safe, the #if option should be preferred. share|improve this answer edited Apr 12 at 2
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and #ifdef 0 in c policies of this site About Us Learn more about Stack Overflow the
#if 0
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
#if 0 In C
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes http://stackoverflow.com/questions/426736/error-macro-names-must-be-identifiers-using-ifdef-0 a minute: Sign up error: macro names must be identifiers up vote 2 down vote favorite I keep getting the error "macro names must be identifiers" in the following code, and I'm not sure why. I haven't violated any of the naming standards as far as I know. This is from my "dllist.h" file: #ifndef _DOUBLY_LINKED_LIST_ #define _DOUBLY_LINKED_LIST_ template
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about http://stackoverflow.com/questions/5455370/command-line-error-in-makefiles Stack Overflow the company Business Learn more about hiring developers or posting ads with https://www.altera.com/support/support-resources/knowledge-base/solutions/rd11172011_386.html us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up
All CPLDs » Configuration Program Storage Power PowerSoC Converters DDR Memory Termination All Devices » Intellectual Property What's New in IP Best in Class IP Nios II Processor Find IP Reference Designs Boards & Kits Development Kits Daughter Cards Cables & Adapters SoC System-on-Modules Design Software What's New Quartus Prime Software Altera SDK for OpenCL DSP Builder SoC Development Tools SoC EDS ARM DS-5 AE All Products Industry Solutions Automotive Broadcast Computer & Storage Consumer Industrial Medical Military, Aerospace & Gov Test & Measurement Wireless Wireline Technology Heterogeneous Integration Machine Learning Digital Signal Processing External Memory Security Transceivers Intelligent Vision & Video Internet of Things Partners Design Solutions Network COTS Board Partners EDA Partners End Market Partners Mathworks Partnership OpenCL Partners SoC Partners Training Partners System Design Journal Help and solutions for tomorrow's design.by Ron Wilson,Editor-in-Chief Design Solutions New to FPGAs Product Selector Design Store All Solutions