Re: C-specific compiler parameters (was: Update on Changes/PortingToModernC)

2023-05-10 Thread Björn Persson
Jakub Jelinek wrote:
> On Wed, May 10, 2023 at 12:09:10AM +0200, Björn Persson wrote:
> > Florian Weimer wrote:  
> > > I am going to explore a way to land -Werror=implicit-int
> > > -Werror=implicit-function-declaration among the default compiler flags.
> > > There's a bit of an issue because the C++ front end warns on
> > > those flags, so we need another -specs= kludge that is incompatible with
> > > Clang.  
> > 
> > It sounds like those parameters should be added only to CFLAGS, not to
> > CXXFLAGS.
> > 
> > __global_compiler_flags already contains things that cause warnings
> > from the Ada and Fortran compilers. The Ada packages get the warning
> > “'-Werror=' argument '-Werror=format-security' is not valid for Ada”
> > over and over. It doesn't break any builds but it's annoying noise in
> > the build logs.  
> 
> GCC 13 has a solution for that, one can add
> -Wno-complain-wrong-lang
> to
> -Werror=format-security
> etc. and avoid such warnings (that some compiler option is only appropriate
> for a subset of GCC languages and it is compiling some other language).

Thanks. That's an acceptable workaround, and seems to work as
advertised. I may add it to build_adaflags if a central solution won't
be accepted.

It would still be better to use parameters only where they are
meaningful. Longer command lines make troubleshooting more difficult.

Björn Persson


pgpxBrQsHBX2P.pgp
Description: OpenPGP digital signatur
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: C-specific compiler parameters (was: Update on Changes/PortingToModernC)

2023-05-09 Thread Jakub Jelinek
On Wed, May 10, 2023 at 12:09:10AM +0200, Björn Persson wrote:
> Florian Weimer wrote:
> > I am going to explore a way to land -Werror=implicit-int
> > -Werror=implicit-function-declaration among the default compiler flags.
> > There's a bit of an issue because the C++ front end warns on
> > those flags, so we need another -specs= kludge that is incompatible with
> > Clang.
> 
> It sounds like those parameters should be added only to CFLAGS, not to
> CXXFLAGS.
> 
> __global_compiler_flags already contains things that cause warnings
> from the Ada and Fortran compilers. The Ada packages get the warning
> “'-Werror=' argument '-Werror=format-security' is not valid for Ada”
> over and over. It doesn't break any builds but it's annoying noise in
> the build logs.

GCC 13 has a solution for that, one can add
-Wno-complain-wrong-lang
to
-Werror=format-security
etc. and avoid such warnings (that some compiler option is only appropriate
for a subset of GCC languages and it is compiling some other language).

Jakub
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


C-specific compiler parameters (was: Update on Changes/PortingToModernC)

2023-05-09 Thread Björn Persson
Florian Weimer wrote:
> I am going to explore a way to land -Werror=implicit-int
> -Werror=implicit-function-declaration among the default compiler flags.
> There's a bit of an issue because the C++ front end warns on
> those flags, so we need another -specs= kludge that is incompatible with
> Clang.

It sounds like those parameters should be added only to CFLAGS, not to
CXXFLAGS.

__global_compiler_flags already contains things that cause warnings
from the Ada and Fortran compilers. The Ada packages get the warning
“'-Werror=' argument '-Werror=format-security' is not valid for Ada”
over and over. It doesn't break any builds but it's annoying noise in
the build logs.

It would be better if __global_compiler_flags would contain only
language-independent parameters, and language-specific parameters were
added in build_cflags and build_cxxflags.

Björn Persson


pgprOqHou0Nu0.pgp
Description: OpenPGP digital signatur
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue