cpp macro expansion bug/query

Barrie Treloar barrie@camtech.com.au
Sun May 16 00:50:00 GMT 1999


Hi,
When using gcc -E, or cpp, I find that an argument to a macro
is expanded with a single leading and a single trailing space.

This is not what I expected.  I'm not sure if this is what is meant
to happen (at least it doesn't make any sense).

If you use the option -traditional then the macro is expanded correctly,
that is, there are no leading or trailing spaces.

If you use the option -ansi (or no options) then the macro is expanded
incorrectly.

I have attached the test file (foo), with the output from both the
-traditional (foo.traditional) and -ansi (foo.ansi) options.

I am running this in the following environment:
	Windows 98 (4.10.1998)
	Cygwin toolset (gcc --version: egcs-2.91.57)
	
Command invoked:
	gcc -E -x c -ansi foo
	gcc -E -x c -traditional foo

Any suggestions appreciated.

Thanks

Barrie.
foo
# 1 "foo"



Here is the expansion : . foo . 


More information about the Gcc-bugs mailing list