Strange bug in C pre-processor - cygwin 1.0

srk@sanger.ac.uk srk@sanger.ac.uk
Fri Jul 27 08:38:00 GMT 2001


I've just encountered a very strange bug in the C pre-processor in cygwin 1.0 (the
cdrom version.)

The bug manifests itself as the pre-processor just ignoring a subset of the
#include statements in the source file. Exactly which #includes will be ignored
is variable - two successive compiles of the same source file will cause different
include files to be ignored. Obviously, dropping random include files leads to
very odd diagnostics from the compiler but it's easy to see what is happening using the
-E flag to just run the precprocessor. That is enough to show the bug.

What seems to provoke this bug is a very long (>100 lines) single C comment at the
start of the file. The presence of that is what distinguished the broken source file from
all the others which compile OK. When I split the comment into three, the problem
went away.

Environment:

cygwin 1.0
NT 4.0 SP3

I'm happy to send someone enough stuff to re-produce this if needed. (The code
I'm trying to compile is all GPL).

Simon Kelley.






--
-------------------------------------------------------------------------------
Simon Kelley.  srk@sanger.ac.uk  simon@thekelleys.org.uk  

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list