Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Remove warning about ignored optimization argument. #61

Open
varungandhi-src opened this issue Jan 20, 2022 · 0 comments
Open

Remove warning about ignored optimization argument. #61

varungandhi-src opened this issue Jan 20, 2022 · 0 comments

Comments

@varungandhi-src
Copy link
Contributor

varungandhi-src commented Jan 20, 2022

Some software does not plan flags for Clang. Turns out, there are some small divergences between GCC and Clang. For example, here is a warning I got when building postgres with lsif-clang.

[1107/1108] Processing file /workspace/postgres/src/interfaces/libpq/pqexpbuffer.c
warning: optimization flag '-fexcess-precision=standard' is not supported [-Wignored-optimization-argument]

AFAICT, upstream Clang 13 has not added support for this either. According to Zig:

        // Musl adds these args to builds with gcc but clang does not support them.
        //"-fexcess-precision=standard",
        //"-frounding-math",

So it looks like -frounding-math is in the same bucket as well. The problem is that since flags are largely the same across compilation units, you end up with a log with a bunch of gunk per compilation unit, which obscures the actual output. We don't care about this, since we're only generating an index, not build output.

Since we don't care about optimization, we should implicitly append -Wno-ignored-optimization-argument to the end of the command-line. That way, such a spurious warning won't fire.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant