public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: preprocessor/9650: string literal contactenation doesn't work with #include
@ 2003-02-10 22:57 neil
  0 siblings, 0 replies; 7+ messages in thread
From: neil @ 2003-02-10 22:57 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, waid

Synopsis: string literal contactenation doesn't work with #include

State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Mon Feb 10 22:57:32 2003
State-Changed-Why:
    Not a bug.
    
    In standard C/C++  such concatenation does not happen.  It appears it was an undocumented feature of some previous versions of GCC.
    
    If you really miss it, you can probably get what you want through the # operator via indirect macro expansion.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9650


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: preprocessor/9650: string literal contactenation doesn't work with  #include
@ 2003-02-10 23:16 frey waid
  0 siblings, 0 replies; 7+ messages in thread
From: frey waid @ 2003-02-10 23:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/9650; it has been noted by GNATS.

From: frey waid <waid@cisco.com>
To: Neil Booth <neil@daikokuya.co.uk>
Cc: neil@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/9650: string literal contactenation doesn't work with 
 #include
Date: Mon, 10 Feb 2003 15:08:40 -0800

 i tried that but it doesn't work consistently with the newer prescan semantics. 
 for example, if i did this:
 
 #include COMP_INC(me, mips/hello.h)
 
 you'd think it'd expand with the below method:
 
 #include "me/include/mips/hello.h"
 
 unfortunately, mips is a predefined macro.  so it expands to "1".  is there a
 work around for this without having to undefine it?
 
 frey
 
 
 Neil Booth wrote:
 > 
 > frey waid wrote:-
 > 
 > > that's what i was doing before.  so i had this:
 > >
 > > #include COMP_INC(comp,file)
 > >
 > > #define COMP_INC(comp,file)   #comp "/include/" #file
 > >
 > > do you have another method in mind?
 > 
 > Sure 8-)
 > 
 > #include COMP_INC (comp, file)
 > 
 > #define COMP_INC(comp, file) COMP (comp, file)
 > #define COMP(prefix, suffix) str(comp/include/file)
 > #define str(x) #x
 > 
 > Not tested, but you get the idea.
 > 
 > Neil.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: preprocessor/9650: string literal contactenation doesn't work with #include
@ 2003-02-10 23:16 Neil Booth
  0 siblings, 0 replies; 7+ messages in thread
From: Neil Booth @ 2003-02-10 23:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/9650; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.co.uk>
To: frey waid <waid@cisco.com>
Cc: neil@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
	nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/9650: string literal contactenation doesn't work with #include
Date: Mon, 10 Feb 2003 23:09:48 +0000

 frey waid wrote:-
 
 > i tried that but it doesn't work consistently with the newer prescan semantics. 
 > for example, if i did this:
 
 Prescan semantics haven't changed.  Apart from removal of the odd
 segfault ;-)
 
 > #include COMP_INC(me, mips/hello.h)
 > 
 > you'd think it'd expand with the below method:
 > 
 > #include "me/include/mips/hello.h"
 > 
 > unfortunately, mips is a predefined macro.  so it expands to "1".  is there a
 > work around for this without having to undefine it?
 
 No, that's the way C works, because mips is lexed as a token in its own
 right.  You need to use a different path, or #undef mips.  Or, latest
 versions of GCC won't invade your namespace like this with -ansi.  Prior
 versions of GCC were somewhat unpredictable.
 
 Neil.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: preprocessor/9650: string literal contactenation doesn't work with #include
@ 2003-02-10 23:06 Neil Booth
  0 siblings, 0 replies; 7+ messages in thread
From: Neil Booth @ 2003-02-10 23:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/9650; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.co.uk>
To: frey waid <waid@cisco.com>
Cc: neil@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
	nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/9650: string literal contactenation doesn't work with #include
Date: Mon, 10 Feb 2003 23:03:52 +0000

 Neil Booth wrote:-
 
 > frey waid wrote:-
 > 
 > > that's what i was doing before.  so i had this:
 > > 
 > > #include COMP_INC(comp,file)
 > > 
 > > #define COMP_INC(comp,file)   #comp "/include/" #file
 > > 
 > > do you have another method in mind?
 > 
 > Sure 8-)
 > 
 > #include COMP_INC (comp, file)
 > 
 > #define COMP_INC(comp, file) COMP (comp, file)
 > #define COMP(prefix, suffix) str(comp/include/file)
 
 Aargh!  Close but no cigar.
 
 #define COMP(prefix, suffix) str(prefix/include/suffix)
 
 > #define str(x) #x
 > 
 > Not tested, but you get the idea.
  
 Neil.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: preprocessor/9650: string literal contactenation doesn't work with  #include
@ 2003-02-10 23:06 frey waid
  0 siblings, 0 replies; 7+ messages in thread
From: frey waid @ 2003-02-10 23:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/9650; it has been noted by GNATS.

From: frey waid <waid@cisco.com>
To: neil@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: preprocessor/9650: string literal contactenation doesn't work with 
 #include
Date: Mon, 10 Feb 2003 15:01:49 -0800

 that's what i was doing before.  so i had this:
 
 #include COMP_INC(comp,file)
 
 #define COMP_INC(comp,file)   #comp "/include/" #file
 
 do you have another method in mind?
 
 frey
 
 neil@gcc.gnu.org wrote:
 > 
 > Synopsis: string literal contactenation doesn't work with #include
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: neil
 > State-Changed-When: Mon Feb 10 22:57:32 2003
 > State-Changed-Why:
 >     Not a bug.
 > 
 >     In standard C/C++  such concatenation does not happen.  It appears it was an undocumented feature of some previous versions of GCC.
 > 
 >     If you really miss it, you can probably get what you want through the # operator via indirect macro expansion.
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9650


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: preprocessor/9650: string literal contactenation doesn't work with #include
@ 2003-02-10 23:06 Neil Booth
  0 siblings, 0 replies; 7+ messages in thread
From: Neil Booth @ 2003-02-10 23:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/9650; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.co.uk>
To: frey waid <waid@cisco.com>
Cc: neil@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
	nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/9650: string literal contactenation doesn't work with #include
Date: Mon, 10 Feb 2003 23:02:26 +0000

 frey waid wrote:-
 
 > that's what i was doing before.  so i had this:
 > 
 > #include COMP_INC(comp,file)
 > 
 > #define COMP_INC(comp,file)   #comp "/include/" #file
 > 
 > do you have another method in mind?
 
 Sure 8-)
 
 #include COMP_INC (comp, file)
 
 #define COMP_INC(comp, file) COMP (comp, file)
 #define COMP(prefix, suffix) str(comp/include/file)
 #define str(x) #x
 
 Not tested, but you get the idea.
 
 Neil.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* preprocessor/9650: string literal contactenation doesn't work with #include
@ 2003-02-10 22:46 waid
  0 siblings, 0 replies; 7+ messages in thread
From: waid @ 2003-02-10 22:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9650
>Category:       preprocessor
>Synopsis:       string literal contactenation doesn't work with #include
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 10 22:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     frey waid
>Release:        CPP 3.0
>Organization:
>Environment:
sunos 5.6
>Description:
this works for CPP 2.95.3 and earlier:

#include "something" "/dir/" "somethingelse"

it does not work for CPP 3.0
>How-To-Repeat:
see description
>Fix:

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-02-10 23:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-10 22:57 preprocessor/9650: string literal contactenation doesn't work with #include neil
  -- strict thread matches above, loose matches on Subject: below --
2003-02-10 23:16 frey waid
2003-02-10 23:16 Neil Booth
2003-02-10 23:06 Neil Booth
2003-02-10 23:06 frey waid
2003-02-10 23:06 Neil Booth
2003-02-10 22:46 waid

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).