eudev-project / eudev

Repository for eudev development
GNU General Public License v2.0
522 stars 147 forks source link

Fix warnings #222

Closed bbonev closed 2 years ago

bbonev commented 2 years ago

An autoconf test plus a couple of ifdefs based on the result...

I did it that way because I think that ancient compilers should silently ignore unsupported attributes.

Do you have an example ancient compiler to test with? Then we can adjust to the resulting build with it.

ArsenArsen commented 2 years ago

(void)unused_arg; is also portable.

bbonev commented 2 years ago

Now I see that there is one change that deserves a separate PR and review and it got included here (my mistake): https://github.com/eudev-project/eudev/pull/222/commits/dce2732c378656c708baeb4e9a1e2a775372ca66#diff-74ecd06b7b5ba73ee97dbca326e44e3dddf6e8841bda2e073b06bdc4d8bd158d - this one is more serious than the rest from this PR and requires extra attention

About the unused arguments warnings - eudev is Linux only and I have been thinking about a possible scenario where the __attribute__((unused)) may become a problem and I couldn't think of one...

lu-zero commented 2 years ago

About the unused arguments warnings - eudev is Linux only and I have been thinking about a possible scenario where the __attribute__((unused)) may become a problem and I couldn't think of one...

We can restrict to gcc and clang since pcc/tcc/cparser should fail already for unrelated reasons and swcc is no more. I guess just documenting it should be fine.

bbonev commented 2 years ago

I have added a note in the build instructions about the modern C compiler requirement. Also did some rewording of the neighboring paragraphs to use more passive language...

@lu-zero Can you please provide build from source instructions for Gentoo?

lu-zero commented 2 years ago

Sure, I double checked and we already depend on modern (#pragma once) and gnu-compatible (__attribute__) compilers already.