Skip to content

Builds use C-specific flags during Fortran builds #27218

@knedlsepp

Description

@knedlsepp

Issue description

Building Fortran projects currently leads to a massive amount of warning messages

f951: Warning: command line option '-Wformat=1' is valid for C/C++/ObjC/ObjC++ but not for Fortran
f951: Warning: command line option '-Wformat-security' is valid for C/C++/ObjC/ObjC++ but not for Fortran

See e.g. liblapack's log output
This is caused by the format hardening adding those flags to NIX_CFLAGS_COMPILE, which in turn is used also for Fortran builds.

This also leads to the breakage of a build system of one package I try to compile, as it expects gfortran not to produce any warnings for some tests.
I propose thus to disable $NIX_CFLAGS_COMPILE for fortran builds or to disable the format hardening for Fortran by default.

Metadata

Metadata

Assignees

Labels

0.kind: enhancementAdd something new or improve an existing system.2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md3.skill: sprintableA larger issue which is split into distinct actionable tasks

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions