bugManeage - Bugs: bug #66982, Include -std=c99 option to allow...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #66982: Include -std=c99 option to allow building numpy with gcc as old as 4.8.5

Submitter:  Boud Roukema <boud>
Submitted:  Thu 03 Apr 2025 12:13:29 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Thu 03 Apr 2025 12:13:29 PM UTC, original submission:  

This is the '--std=c99' issue for building numpy, following from https://savannah.nongnu.org/task/?16625 , so that an old fix does not get lost. Copy/pasting from Comment 14 over there is the following.

This [6] is ready for merging if there are no objections,


> Commit explaining the Numpy options:
>
> https://git.maneage.org/project.git/commit/?id=fb041fe844074d2556cfc350b52f5742bfb866b3



What I see there is for a double-hyphen '--std=c99' option (I don't see anything about the '-shared' option in that commit). According to that patch, it seems to be needed for old gcc such as 4.8.5 (released 2015), which apparently can compile c99 code.

Newer versions of numpy might require even more recent versions of the C standard, e.g. --std=c11, but I guess there's no point trying to prepare for that; we can implement it if and when it's needed.

Since we (normally) build gcc and have a known version of numpy, the --std=c99 seems safe for the Maneage-built gcc. If it's unsafe for very old gcc (much older than 4.8.5), then people who want backwards portability to old host gcc versions will need to propose a hack for "recent" (2020 or later) numpy.

In commit 90a5fc97 on branch numpy_c99 I restored the '--std=c99' and checked that numpy builds correctly. It worked for me.

There's a question of single '-std=c99' versus double hyphen '--std=c99': GNU seems to recommend the single-hyphen version [4] but allows the double-hyphen version [5]. We do allow clang as a host OS C compiler and clang seems to have the single-hyphen version. I don't know if it accepts the double-hyphen version.

In commit 954cb2e2 [6] I've put the single-hyphen version.

The PROPOSAL: 'Given that GNU recommends single-hyphen and clang allows single-hyphen, my proposal is to use the single-hyphen version. Any objections?' was made nearly two weeks ago on Task #16625 and there were no objections.

So I propose merging commit 954cb2e2 [6].

[4] https://gcc.gnu.org/onlinedocs/gcc/Standards.html

[5] https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/opts-common.cc;h=03b1a79c1c094937d945209252d498aae362dd22;hb=HEAD#l464

[6] https://codeberg.org/boud/maneage_dev/commit/954cb2e26b13bbfd4939cb416d16000ae3bd5f43

Boud Roukema <boud>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by boud (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-04-03 boud SummaryInclud -std=c99 option to allow building numpy with gcc as old as 4.8.5 Include -std=c99 option to allow building numpy with gcc as old as 4.8.5

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code