Different interpretations of #line directive between 3.2 and 2.95.2

Jaeyoung Kim minjub@yahoo.com
Fri Dec 3 01:33:00 GMT 2004

Hi, I found today an interesting difference when
interpreting #line directive between gcc v3.2 and

An example code compiled without problems in v2.95.2
has the followings at the beginning of the code;
#line 1 "/usr/myhome/src/mysrc.c"

#include "../include/myheader.h"
Of course, the header file is located at
/usr/myhome/include directory.

Since the source code has #line directive, the source
code can find the myheader.h even when the
location of the source code is changed in v2.95.2.

However, with v3.2, the compiler produced error
message saying "No such file ../include/myheader.h".

I wonder this is a hidden bug of v3.2 or a changed
feature from v2.95.2. And also I would like to
make v3.2 to be able to find the header file
in the above case. Any comments would be welcomed.

- jay

PS : I know that using the relative path for the
#include directive is not a good way. So, you don't
need to tell me how to bypass this compilation
problem by changing #include directive itself. :)

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Gcc-help mailing list