c++/9394: c++ -include doesn't work

harinath@cs.umn.edu harinath@cs.umn.edu
Wed Jan 22 00:36:00 GMT 2003


>Number:         9394
>Category:       c++
>Synopsis:       c++ -include doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 22 00:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     harinath@cs.umn.edu
>Release:        gcc version 3.4 20030121 (experimental)
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
The following command 

  c++ -o foo.o --include foo.h -c foo.cc

fails with

  c++: cannot specify -o with -c or -S and multiple compilations

It turns out that the c++ driver actually passes

  ... -include xc++-header foo.h ...

to cc1plus.  This is because the 'lang_specific_driver' in gcc/cp/g++spec.c doesn't treat '-include' as a special option requiring an argument.
>How-To-Repeat:

>Fix:
Copy the DEFAULT_WORD_SWITCH_TAKES_ARG from gcc.c into gcc/cp/g++spec.c and use it instead.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list