Error #52 Expected A Macro Parameter Name
armcc are.0 unknown error 1 last line of file ends without a new line 2 last line of file ends with a backslash 3 #include file
LearningModern CodeNetworkingOpen SourceStorageToolsDeveloper TypeEmbedded SystemsGame DevMediaTechnical, Enterprise, HPCWebOSAll ToolsAndroid*HTML5Linux*OS X*Windows*ResourcesCode SamplesContact SupportDocumentationFree SoftwareIntel Registration CenterProduct ForumsSDKsResourcesPartner with IntelAcademic ProgramPartner SpotlightBlack Belt DeveloperDeveloper MeshInnovator ProgramSuccess StoriesLearnBlogBusiness TipsEventsVideosSupportContact SupportDeveloper EvangelistsFAQsForums Search form Search Diagnostic 52: expected a macro parameter name Added November 16, 2008 Translating...TranslateChinese SimplifiedChinese TraditionalEnglishFrenchGermanItalianPortugueseRussianSpanishTurkish This is a computer translation of the original content. It is provided for http://infocenter.arm.com/help/topic/com.arm.doc.dui0496c/BABDJCCI.html general information only and should not be relied upon as complete or accurate. Share Tweet Share Diagnostic 52: expected a macro parameter nameThank you for your interest in this diagnostic message. We are still in the process of documenting https://software.intel.com/en-us/articles/cdiag52 this specific diagnostic.Please let us know of your experience with this diagnostic message by posting a comment below. Your interest in this diagnostic will help us prioritize the order we document diagnostics. For more complete information about compiler optimizations, see our Optimization Notice. Categories: Intel® C++ Compiler Intel® Parallel Studio XE Composer Edition C/C++ Linux* Apple OS X* Microsoft Windows* (XP, Vista, 7) Tags: error warning remark ForumsTools Add a Comment Top (For technical discussions visit our developer forums. For site or software product issues contact support.) Please sign in to add a comment. Not a member? Join today Support Terms of Use *Trademarks Privacy Cookies Publications Intel® Developer Zone Newsletter Intel® Parallel Universe Magaz
When they work, they work great. When they have bugs, they are a pain to troubleshoot. Macros are a simple text substitution done by the preprocessor. Whenever the macro name is encountered in your code, the http://www.complete-concrete-concise.com/programming/c/compilation-error-improperly-defined-macro preprocessor replaces it with the text to the right of the macro https://sourceforge.net/p/freertos/discussion/382005/thread/51ce0008/ name (plugging in any optional parameters you may have passed). A macro is composed of three parts: #define - this introduces the macro macro name and optional parameter list. The macro name cannot have any spaces and the parameter list cannot be separated from the macro name with any spaces. text error #52 that will replace the macro - everything following the macro name (and optional parameter list), until the end of the line, is what the preprocessor will use to replace the macro name. For long macros, or for better formatting, the macro can be defined over several lines by ending each line with a backslash character (\) and a new line (enter) (extra spaces between error #52 expected the backslash character and new line means the macro ends there - so be careful of extra spaces following the backslash). Working Examples:
#define my_macro // preprocessor will replace my_macro with this comment.
#define my_macro // when the preprocessor encounters my_macro, \ it will replace it with everything on this \ line that is to the right of the definition \ (which is this comment). Fortunately, \ it is possible to spread the line over several \ lines by using the backslash character
Not Working Examples: The following macro won't compile following expansion (it is supposed to replace the macro with the contents of the parameter list): #define my_macro (x) x
my_macro(int a); The (unhelpful but correct) error message from the compiler (GCC v.4.4.1) is: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'x' The problem is the space between the macro name and the parameter list - there should be none. Here's another macro that won't compile (like the one above, it is supposed to replace the macro with the parameters passed) : #define my_macro (x, y) x y my_macro(int, abc); The (unhelpful but corrFreeRTOS Real Time Kernel (RTOS) Market leading real time kernel for 32 microcontroller architectures Brought to you by: rtel Summary Files Reviews Support Wiki Tickets ▾ Feature Requests Bugs News Discussion Donate Code Create Topic Stats Graph Forums Open Discussion and Support 6216 Help Formatting Help LPC2888 port Forum: Open Discussion and Support Creator: Widita Budhysutanto Created: 2008-10-28 Updated: 2013-09-16 Widita Budhysutanto - 2008-10-28 Hi, I tried to convert the demo project "ARM7_LPC2129_Keil", and it seems there is something wrong with the portmacro.h, it can't be compiled... here is the compilation error messages: Build target 'LPC2888' assembling Startup.s... compiling main.c... ..\..\Source\include\..\..\Source\portable\Keil\ARM7\portmacro.h(112): error: #52: expected a macro parameter name portmacro.h line 112: __asm{ LDR LR, [LR, #+60] }; /* Restore the return address. */ \ And here is the IDE-Version of my Keil UV3 IDE-Version: µVision3 V3.50 Copyright (c) Keil Elektronik GmbH / Keil Software, Inc. 1995 - 2007 Tool Version Numbers: Toolchain Path: C:\Keil\ARM\BIN30\ C Compiler: ARMCC.Exe V3.0.0.951 Assembler: ARMASM.Exe V3.0.0.951 Linker/Locator: ARMLINK.Exe V3.0.0.951 Librarian: ARMAR.Exe V3.0.0.951 Hex Converter: FROMELF.Exe V3.0.0.951 CPU DLL: SARM.DLL V3.04 Dialog DLL: DARMP.DLL V1.13 Target DLL: BIN\UL2ARM.DLL V1.26 Dialog DLL: TARMP.DLL V1.11f My question is, are we using different compiler? because it seems that