public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Deprecate -traditional-cpp?
@ 2019-09-05 11:08 Nathan Sidwell
  2019-09-05 11:16 ` Janne Blomqvist
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Nathan Sidwell @ 2019-09-05 11:08 UTC (permalink / raw)
  To: gcc

Is it time to deprecate traditional preprocessing?  It's been  30 years 
since C89.  Are (non-compiler) tools that use it still things?

Handling it gets its hooks into a bunch of odd places in libcpp.

To be specific: deprecate -traditional-cpp for GCC10, remove in GCC11.

nathan

-- 
Nathan Sidwell

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

* Re: Deprecate -traditional-cpp?
  2019-09-05 11:08 Deprecate -traditional-cpp? Nathan Sidwell
@ 2019-09-05 11:16 ` Janne Blomqvist
  2019-09-05 14:03   ` Steve Kargl
  2019-09-05 12:33 ` Andreas Schwab
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Janne Blomqvist @ 2019-09-05 11:16 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: gcc, Fortran List

On Thu, Sep 5, 2019 at 2:08 PM Nathan Sidwell <nathan@acm.org> wrote:
>
> Is it time to deprecate traditional preprocessing?  It's been  30 years
> since C89.  Are (non-compiler) tools that use it still things?
>
> Handling it gets its hooks into a bunch of odd places in libcpp.
>
> To be specific: deprecate -traditional-cpp for GCC10, remove in GCC11.

The Fortran frontend uses traditional mode, for reasons I can't recall
at the moment.



-- 
Janne Blomqvist

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

* Re: Deprecate -traditional-cpp?
  2019-09-05 11:08 Deprecate -traditional-cpp? Nathan Sidwell
  2019-09-05 11:16 ` Janne Blomqvist
@ 2019-09-05 12:33 ` Andreas Schwab
  2019-09-05 12:45   ` Jakub Jelinek
  2019-09-05 12:48 ` Florian Weimer
  2019-09-05 13:01 ` Martin Jambor
  3 siblings, 1 reply; 11+ messages in thread
From: Andreas Schwab @ 2019-09-05 12:33 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: gcc

On Sep 05 2019, Nathan Sidwell <nathan@acm.org> wrote:

> Is it time to deprecate traditional preprocessing?  It's been  30 years
> since C89.  Are (non-compiler) tools that use it still things?

It's probably still used together with -xassembler-with-cpp.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

* Re: Deprecate -traditional-cpp?
  2019-09-05 12:33 ` Andreas Schwab
@ 2019-09-05 12:45   ` Jakub Jelinek
  2019-09-05 12:59     ` Florian Weimer
  0 siblings, 1 reply; 11+ messages in thread
From: Jakub Jelinek @ 2019-09-05 12:45 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Nathan Sidwell, gcc

On Thu, Sep 05, 2019 at 02:33:35PM +0200, Andreas Schwab wrote:
> On Sep 05 2019, Nathan Sidwell <nathan@acm.org> wrote:
> 
> > Is it time to deprecate traditional preprocessing?  It's been  30 years
> > since C89.  Are (non-compiler) tools that use it still things?
> 
> It's probably still used together with -xassembler-with-cpp.

I think not by default.  Generally, traditional preprocessing is used
often for preprocessing of something that isn't actually C/C++, but
something different.  imake (guess that is not used anymore), other
Makefile/assembler/etc. preprocessing.

	Jakub

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

* Re: Deprecate -traditional-cpp?
  2019-09-05 11:08 Deprecate -traditional-cpp? Nathan Sidwell
  2019-09-05 11:16 ` Janne Blomqvist
  2019-09-05 12:33 ` Andreas Schwab
@ 2019-09-05 12:48 ` Florian Weimer
  2019-09-05 13:01 ` Martin Jambor
  3 siblings, 0 replies; 11+ messages in thread
From: Florian Weimer @ 2019-09-05 12:48 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: gcc

* Nathan Sidwell:

> Is it time to deprecate traditional preprocessing?  It's been  30
> years since C89.  Are (non-compiler) tools that use it still things?

Doesn't imake still use it?

checking for cpp... /usr/bin/cpp
checking if /usr/bin/cpp requires -undef... yes
checking if /usr/bin/cpp requires -traditional... yes

Thanks,
Florian

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

* Re: Deprecate -traditional-cpp?
  2019-09-05 12:45   ` Jakub Jelinek
@ 2019-09-05 12:59     ` Florian Weimer
  0 siblings, 0 replies; 11+ messages in thread
From: Florian Weimer @ 2019-09-05 12:59 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Andreas Schwab, Nathan Sidwell, gcc

* Jakub Jelinek:

> On Thu, Sep 05, 2019 at 02:33:35PM +0200, Andreas Schwab wrote:
>> On Sep 05 2019, Nathan Sidwell <nathan@acm.org> wrote:
>> 
>> > Is it time to deprecate traditional preprocessing?  It's been  30 years
>> > since C89.  Are (non-compiler) tools that use it still things?
>> 
>> It's probably still used together with -xassembler-with-cpp.
>
> I think not by default.  Generally, traditional preprocessing is used
> often for preprocessing of something that isn't actually C/C++, but
> something different.  imake (guess that is not used anymore),

Getting close, but imake is still used in some builds:

 automake-1.16.1-13.fc31.src
 freenx-server-0.7.3-47.fc31.src
 ibp-0.21-21.fc31.src
 isdn4k-utils-3.27-17.fc30.src
 kdebase3-3.5.10-58.fc31.src
 MagicPoint-1.13a-24.fc31.src
 mrxvt-0.5.3-25.fc31.src
 nas-1.9.4-17.fc31.src
 ncl-6.6.2-2.fc32.src
 numlockx-1.2-16.fc31.src
 nx-libs-3.5.99.21-2.fc32.src
 oneko-1.2-28.fc31.src
 oyranos-0.9.5-29.fc31.src
 tgif-4.2.5-19.fc31.src
 x11-ssh-askpass-1.2.4.1-28.fc31.src
 xautolock-2.2-26.fc31.src
 xgrep-0.08-12.fc31.src
 xkeycaps-2.46-26.fc31.src
 xmountains-2.9-3.D20170103git3ba444a4f7.fc31.3.src
 xskat-4.0.0-23.fc31.src
 xstar-2.2.0-22.fc31.src
 xvkbd-3.9-5.fc31.src
 xxkb-1.11.1-6.fc31.src

Thanks,
Florian

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

* Re: Deprecate -traditional-cpp?
  2019-09-05 11:08 Deprecate -traditional-cpp? Nathan Sidwell
                   ` (2 preceding siblings ...)
  2019-09-05 12:48 ` Florian Weimer
@ 2019-09-05 13:01 ` Martin Jambor
  3 siblings, 0 replies; 11+ messages in thread
From: Martin Jambor @ 2019-09-05 13:01 UTC (permalink / raw)
  To: Nathan Sidwell, gcc

Hi,

On Thu, Sep 05 2019, Nathan Sidwell wrote:
> Is it time to deprecate traditional preprocessing?  It's been  30 years 
> since C89.  Are (non-compiler) tools that use it still things?

xrdb runs .Xdefaults and I believe .Xresources files through the
pre-processor and I still use the latter to configure my desktop.

I cannot however find the string "traditional" in
https://gitlab.freedesktop.org/xorg/app/xrdb/blob/master/xrdb.c so
perhaps it does not use that option.

Martin

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

* Re: Deprecate -traditional-cpp?
  2019-09-05 11:16 ` Janne Blomqvist
@ 2019-09-05 14:03   ` Steve Kargl
  2019-09-05 14:08     ` Steve Kargl
  0 siblings, 1 reply; 11+ messages in thread
From: Steve Kargl @ 2019-09-05 14:03 UTC (permalink / raw)
  To: Janne Blomqvist; +Cc: Nathan Sidwell, gcc, Fortran List

On Thu, Sep 05, 2019 at 02:16:08PM +0300, Janne Blomqvist wrote:
> On Thu, Sep 5, 2019 at 2:08 PM Nathan Sidwell <nathan@acm.org> wrote:
> >
> > Is it time to deprecate traditional preprocessing?  It's been  30 years
> > since C89.  Are (non-compiler) tools that use it still things?
> >
> > Handling it gets its hooks into a bunch of odd places in libcpp.
> >
> > To be specific: deprecate -traditional-cpp for GCC10, remove in GCC11.
> 
> The Fortran frontend uses traditional mode, for reasons I can't recall
> at the moment.
> 

Modern C allows single line comments to start with //

program hello
   print *, "Hello " // "world!"
end progra


-- 
Steve

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

* Re: Deprecate -traditional-cpp?
  2019-09-05 14:03   ` Steve Kargl
@ 2019-09-05 14:08     ` Steve Kargl
  2019-09-05 15:53       ` Steve Kargl
  0 siblings, 1 reply; 11+ messages in thread
From: Steve Kargl @ 2019-09-05 14:08 UTC (permalink / raw)
  To: Janne Blomqvist; +Cc: Nathan Sidwell, gcc, Fortran List

On Thu, Sep 05, 2019 at 07:03:25AM -0700, Steve Kargl wrote:
> On Thu, Sep 05, 2019 at 02:16:08PM +0300, Janne Blomqvist wrote:
> > On Thu, Sep 5, 2019 at 2:08 PM Nathan Sidwell <nathan@acm.org> wrote:
> > >
> > > Is it time to deprecate traditional preprocessing?  It's been  30 years
> > > since C89.  Are (non-compiler) tools that use it still things?
> > >
> > > Handling it gets its hooks into a bunch of odd places in libcpp.
> > >
> > > To be specific: deprecate -traditional-cpp for GCC10, remove in GCC11.
> > 
> > The Fortran frontend uses traditional mode, for reasons I can't recall
> > at the moment.
> > 
> 
> Modern C allows single line comments to start with //
> 
> program hello
>    print *, "Hello " // "world!"
> end program

With trunk,

% ~/work/bin/cpp hello.F90
# 1 "hello.F90"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "hello.F90"
program hello
   print *, "Hello "
end program

-- 
Steve

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

* Re: Deprecate -traditional-cpp?
  2019-09-05 14:08     ` Steve Kargl
@ 2019-09-05 15:53       ` Steve Kargl
  2019-09-05 19:31         ` Gaius Mulley
  0 siblings, 1 reply; 11+ messages in thread
From: Steve Kargl @ 2019-09-05 15:53 UTC (permalink / raw)
  To: Janne Blomqvist; +Cc: Nathan Sidwell, gcc, Fortran List

On Thu, Sep 05, 2019 at 07:08:48AM -0700, Steve Kargl wrote:
> On Thu, Sep 05, 2019 at 07:03:25AM -0700, Steve Kargl wrote:
> > On Thu, Sep 05, 2019 at 02:16:08PM +0300, Janne Blomqvist wrote:
> > > On Thu, Sep 5, 2019 at 2:08 PM Nathan Sidwell <nathan@acm.org> wrote:
> > > >
> > > > Is it time to deprecate traditional preprocessing?  It's been  30 years
> > > > since C89.  Are (non-compiler) tools that use it still things?
> > > >
> > > > Handling it gets its hooks into a bunch of odd places in libcpp.
> > > >
> > > > To be specific: deprecate -traditional-cpp for GCC10, remove in GCC11.
> > > 
> > > The Fortran frontend uses traditional mode, for reasons I can't recall
> > > at the moment.
> > > 
> > 
> > Modern C allows single line comments to start with //
> > 
> > program hello
> >    print *, "Hello " // "world!"
> > end program
> 
> With trunk,
> 
> % ~/work/bin/cpp hello.F90
> # 1 "hello.F90"
> # 1 "<built-in>"
> # 1 "<command-line>"
> # 1 "hello.F90"
> program hello
>    print *, "Hello "
> end program
> 

There are 9 open PRs about cpp and Fortran.  Of those nine, these
seem to be important for moving to modern cpp.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67623
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56659
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53934
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42954
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662

-- 
Steve

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

* Re: Deprecate -traditional-cpp?
  2019-09-05 15:53       ` Steve Kargl
@ 2019-09-05 19:31         ` Gaius Mulley
  0 siblings, 0 replies; 11+ messages in thread
From: Gaius Mulley @ 2019-09-05 19:31 UTC (permalink / raw)
  To: gcc; +Cc: Janne Blomqvist, Nathan Sidwell, Fortran List, Steve Kargl

Steve Kargl <sgk@troutmask.apl.washington.edu> writes:

> On Thu, Sep 05, 2019 at 07:08:48AM -0700, Steve Kargl wrote:
>> On Thu, Sep 05, 2019 at 07:03:25AM -0700, Steve Kargl wrote:
>> > On Thu, Sep 05, 2019 at 02:16:08PM +0300, Janne Blomqvist wrote:
>> > > On Thu, Sep 5, 2019 at 2:08 PM Nathan Sidwell <nathan@acm.org> wrote:
>> > > >
>> > > > Is it time to deprecate traditional preprocessing?  It's been  30 years
>> > > > since C89.  Are (non-compiler) tools that use it still things?
>> > > >
>> > > > Handling it gets its hooks into a bunch of odd places in libcpp.
>> > > >
>> > > > To be specific: deprecate -traditional-cpp for GCC10, remove in GCC11.
>> > > 
>> > > The Fortran frontend uses traditional mode, for reasons I can't recall
>> > > at the moment.
>> > > 
>> > 
>> > Modern C allows single line comments to start with //
>> > 
>> > program hello
>> >    print *, "Hello " // "world!"
>> > end program
>> 
>> With trunk,
>> 
>> % ~/work/bin/cpp hello.F90
>> # 1 "hello.F90"
>> # 1 "<built-in>"
>> # 1 "<command-line>"
>> # 1 "hello.F90"
>> program hello
>>    print *, "Hello "
>> end program
>> 
>
> There are 9 open PRs about cpp and Fortran.  Of those nine, these
> seem to be important for moving to modern cpp.
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67623
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56659
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53934
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42954
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28662

for the sake of completeness - Modula-2 can also use cpp in traditional
mode.  I quite like the solution suggested in:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67623

"Fortran devs need to add a Fortran mode to CPP." which could apply to
Modula-2 as well


regards,
Gaius

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

end of thread, other threads:[~2019-09-05 19:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05 11:08 Deprecate -traditional-cpp? Nathan Sidwell
2019-09-05 11:16 ` Janne Blomqvist
2019-09-05 14:03   ` Steve Kargl
2019-09-05 14:08     ` Steve Kargl
2019-09-05 15:53       ` Steve Kargl
2019-09-05 19:31         ` Gaius Mulley
2019-09-05 12:33 ` Andreas Schwab
2019-09-05 12:45   ` Jakub Jelinek
2019-09-05 12:59     ` Florian Weimer
2019-09-05 12:48 ` Florian Weimer
2019-09-05 13:01 ` Martin Jambor

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