Deprecate -traditional-cpp?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Deprecate -traditional-cpp?

Nathan Sidwell-2
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
Reply | Threaded
Open this post in threaded view
|

Re: Deprecate -traditional-cpp?

Janne Blomqvist-3
On Thu, Sep 5, 2019 at 2:08 PM Nathan Sidwell <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Deprecate -traditional-cpp?

Andreas Schwab
In reply to this post by Nathan Sidwell-2
On Sep 05 2019, Nathan Sidwell <[hidden email]> 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, [hidden email]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Reply | Threaded
Open this post in threaded view
|

Re: Deprecate -traditional-cpp?

Jakub Jelinek
On Thu, Sep 05, 2019 at 02:33:35PM +0200, Andreas Schwab wrote:
> On Sep 05 2019, Nathan Sidwell <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Deprecate -traditional-cpp?

Florian Weimer-5
In reply to this post by Nathan Sidwell-2
* 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
Reply | Threaded
Open this post in threaded view
|

Re: Deprecate -traditional-cpp?

Florian Weimer-5
In reply to this post by Jakub Jelinek
* Jakub Jelinek:

> On Thu, Sep 05, 2019 at 02:33:35PM +0200, Andreas Schwab wrote:
>> On Sep 05 2019, Nathan Sidwell <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Deprecate -traditional-cpp?

Martin Jambor-3
In reply to this post by Nathan Sidwell-2
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
Reply | Threaded
Open this post in threaded view
|

Re: Deprecate -traditional-cpp?

Steve Kargl
In reply to this post by Janne Blomqvist-3
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 <[hidden email]> 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