Bug 260136 - /usr/include/omp.h fails to compile with -ansi flag: error: unknown type name 'inline'
Summary: /usr/include/omp.h fails to compile with -ansi flag: error: unknown type name...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-standards (Nobody)
Depends on:
Reported: 2021-11-30 10:07 UTC by Yuri Victorovich
Modified: 2021-11-30 22:22 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2021-11-30 10:07:55 UTC
Testcase: port math/csdp version 6.2.0

Log: http://beefy18.nyi.freebsd.org/data/main-amd64-default/pd99f40d544e4_sc3134a6af0/logs/coin-or-csdp-6.2.0.log

> cc -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -fopenmp -ansi -Wall -DBIT64 -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include   -c -o op_o.o op_o.c
> In file included from op_o.c:15:
> /usr/include/omp.h:485:12: error: unknown type name 'inline'
>     static inline int omp_is_initial_device(void) { return 1; }
>            ^
> 1 error generated.
Comment 1 Ed Maste freebsd_committer 2021-11-30 19:39:58 UTC
Could the port just build with -std=c99 instead?
Comment 2 Yuri Victorovich freebsd_committer 2021-11-30 19:43:44 UTC

> Could the port just build with -std=c99 instead?

It can be built with -std=c99. I filed this PR because I wasn't sure if base headers are expected to be ansi-comatible. If this isn't the case - please close this PR.
Comment 3 Ed Maste freebsd_committer 2021-11-30 21:28:21 UTC
(In reply to Yuri Victorovich from comment #2)
That's a good question. I don't think we have an explicit statement. Most of the top-level headers (/usr/include/*.h) are c89 compatible, while there are a lot of headers elsewhere under /usr/include that are not.

IMO standard C/POSIX headers ought to be, but should not be required for headers that are not specified by C/POSIX.
Comment 4 Warner Losh freebsd_committer 2021-11-30 21:50:01 UTC
(In reply to Ed Maste from comment #3)
This file comes from llvm upstream.
This change is a recent regression, older versions of omp.h don't have this problem.
If anything, it should be a problem for upstream to fix.
Comment 5 Ed Maste freebsd_committer 2021-11-30 22:22:03 UTC
Reference: https://reviews.llvm.org/D99447