Search the FAQ Archives

3 - 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
faqs.org - Internet FAQ Archives

comp.sys.hp.hpux FAQ
Section - 6.2.6 Why do I get the error "*Initialization*:1: missing token-sequence in `#assert'" when I compile with gcc?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Counties ]


Top Document: comp.sys.hp.hpux FAQ
Previous Document: 6.2.5 Is there some kind of problem with using FLT_MIN in ANSI mode?
Next Document: 6.2.7 How can I detect the HP-UX version at compile time?
See reader questions & answers on this topic! - Help others by sharing your knowledge
Updated: 04/18/01

This error is caused by the HP and GNU compilers using the -A command
line option for different things.

The HP compiler uses -A to set which dialect of C the compiler expects
to see in the input files, K&R (-Ac), ANSI (-Aa) or Extended ANSI (-Ae).
In recent versions, Extended ANSI mode is the default.  In earlier
versions, K&R mode is the default.

The GNU compiler has a conditional compilation mechanism that allows
questions to be asked during the compilation using the construct '#if
#question(answer)' and a mechanism of telling the compiler in advance
the answers to questions with the construct '#assert question(answer)'.
For the GNU compiler the -A optoion is equivalent to a #assert
directive.

The error message above occurs when the GNU compiler gets the option -Aa
intended for the HP compiler and reads it as an attempt to provide the
answer to the question 'a' but the answer itself (which would appear in
brackets) is missing.

The problem can be resolved by removing the -Aa option from the command
line used for the compiler (check Makefiles for CC and CFLAGS settings)
as the GNU compiler defaults to understanding ANSI C anyway.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: comp.sys.hp.hpux FAQ
Previous Document: 6.2.5 Is there some kind of problem with using FLT_MIN in ANSI mode?
Next Document: 6.2.7 How can I detect the HP-UX version at compile time?

Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
hpux.faq@gmail.com





Last Update March 27 2014 @ 02:11 PM