Hi C experts,
In my code I have got
#pragma extern_prefix (push, "");
Some extern function declarations
#pragma extern_prefix (pop, "");
So that compiler does not prepend anything to those extern functions , I get an error

error #14: extra text after expected end of preprocessing directive

Does anyone know how to fix this syntax error ?

Recommended Answers

All 6 Replies

What C compiler are you using? What's this pragma format description in the compiler manuals?

Hi C experts,
In my code I have got
#pragma extern_prefix (push, "");
Some extern function declarations
#pragma extern_prefix (pop, "");
So that compiler does not prepend anything to those extern functions , I get an error

error #14: extra text after expected end of preprocessing directive

Does anyone know how to fix this syntax error ?

I may be wrong but if this pragma is acting as preprocessor directive then it should not have any ";" at its end. Right?
(Even the error coming is also showing that...)

A semicolon can be useful in some preprocessor commands (probably some bizarre scenario), for example its perfectly valid in a #define statement. In this case we do need to know the compiler and its definition of #pragma because its functionality is not standard.

#pragma extern_prefix (push, "")
#pragma extern_prefix (pop) worked , marking it as solved.

A semicolon can be useful in some preprocessor commands (probably some bizarre scenario), for example its perfectly valid in a #define statement. In this case we do need to know the compiler and its definition of #pragma because its functionality is not standard.

Well according to my knowledge semicolons are not used in any of the preprocessor directives because of the fact that preprocessor directives are mostly used within the coding statements and the appearance of ";" would mark the end of that statement.

I didn't say it was a good idea, but the real question here was about the compile error.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.