This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

preprocessor/10014: Problems with "#include __BASE_FILE__" in different dirrectories


>Number:         10014
>Category:       preprocessor
>Synopsis:       Problems with "#include  __BASE_FILE__" in different dirrectories
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 10 10:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     ilgis at num dot uni-sb dot de
>Release:        gcc-2.95.3, gcc-3.0, gcc-3.2
>Organization:
>Environment:
Linux Red Hat 7.1 and Linux Suse 8.0
>Description:
Let's create a simple "test.c" file with only one line:
/******************* begin test.c ********************/
#include "in.h"
/******************* end test.c **********************/
and create this header file "in.h" as following:
/******************* begin in.h **********************/
#ifndef     SWSIZE
  #define   SWSIZE 1
  #include  __BASE_FILE__
  #undef    SWSIZE
  #define   SWSIZE 2
#endif

#if ( SWSIZE == 1 )
// some special definitions
#else
// some special definitions
#endif
/********************** end in.h ********************/

if both files are in the same dirrectory then we can
succesfully compile it with the following command:
cc -c test.c
but if "in.h" is, for example, in INCLUDE dirrectory, then
cc -c -IINCLUDE test.c
produces the following message:
In file included from test.c:1:
INCLUDE/in.h:3: test.c: No such file or directory

It is possible to solve it by dirrective like:
cc -c -IINCLUDE $(PWD)/test.c
but it seems a little bit strange!
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]