* gcc -C acts different between 2.7.2.2 and 2.95.2
@ 1999-11-22 9:52 kevin_collins
1999-11-30 23:28 ` kevin_collins
0 siblings, 1 reply; 2+ messages in thread
From: kevin_collins @ 1999-11-22 9:52 UTC (permalink / raw)
To: help-gcc
I am reposting this with more information. Any help would be
appreciated.
We are seeing different output when using 'gcc -E -C -P -undef' on the
same file with gcc versions 2.7.2.2 and 2.95.2. Here is an example
illustrating the difference.
Source (xxx.c) :
--
#define XYZ_ABC /* Define XYZ_ABC */
#ifdef ABC_XYZ /* ifdef ABC_XYZ */
#define ABC_XYZ_DEFINED
#endif /* endif ABC_XYZ */
main()
{
printf ("this is a string\n"); /* printf */
/* comment only here */
}
--
2.7.2.2 output:
--
# gcc -E -C -P -undef xxx.c
main()
{
printf ("this is a string\n"); /* printf */
/* comment only here */
}
--
2.95.2 output:
--
# gcc -E -C -P -undef xxx.c
/* Define XYZ_ABC */
/* ifdef ABC_XYZ *//* endif ABC_XYZ */
main()
{
printf ("this is a string\n"); /* printf */
/* comment only here */
}
--
So the question is - which of these behaviors is correct? We are using
gcc to parse files that are NOT C source and thus '/* */' structures for
comments are invalid. However, because we only want the pre-processor to
handle the directives, we don't want it to get rid of anything because
it "thinks" its a C comment.
Comments?
Thanks,
Kevin
Sent via Deja.com http://www.deja.com/
Before you buy.
^ permalink raw reply [flat|nested] 2+ messages in thread
* gcc -C acts different between 2.7.2.2 and 2.95.2
1999-11-22 9:52 gcc -C acts different between 2.7.2.2 and 2.95.2 kevin_collins
@ 1999-11-30 23:28 ` kevin_collins
0 siblings, 0 replies; 2+ messages in thread
From: kevin_collins @ 1999-11-30 23:28 UTC (permalink / raw)
To: help-gcc
I am reposting this with more information. Any help would be
appreciated.
We are seeing different output when using 'gcc -E -C -P -undef' on the
same file with gcc versions 2.7.2.2 and 2.95.2. Here is an example
illustrating the difference.
Source (xxx.c) :
--
#define XYZ_ABC /* Define XYZ_ABC */
#ifdef ABC_XYZ /* ifdef ABC_XYZ */
#define ABC_XYZ_DEFINED
#endif /* endif ABC_XYZ */
main()
{
printf ("this is a string\n"); /* printf */
/* comment only here */
}
--
2.7.2.2 output:
--
# gcc -E -C -P -undef xxx.c
main()
{
printf ("this is a string\n"); /* printf */
/* comment only here */
}
--
2.95.2 output:
--
# gcc -E -C -P -undef xxx.c
/* Define XYZ_ABC */
/* ifdef ABC_XYZ *//* endif ABC_XYZ */
main()
{
printf ("this is a string\n"); /* printf */
/* comment only here */
}
--
So the question is - which of these behaviors is correct? We are using
gcc to parse files that are NOT C source and thus '/* */' structures for
comments are invalid. However, because we only want the pre-processor to
handle the directives, we don't want it to get rid of anything because
it "thinks" its a C comment.
Comments?
Thanks,
Kevin
Sent via Deja.com http://www.deja.com/
Before you buy.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-11-30 23:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-22 9:52 gcc -C acts different between 2.7.2.2 and 2.95.2 kevin_collins
1999-11-30 23:28 ` kevin_collins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).