-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix implicit function declarations with clang #382
Conversation
Will be counted as errors starting with CLANG-16
What are the offending functions? Maybe we could just replace them with the "correct" ones instead of adding a magic define. |
Sorry, missed to give that information. |
I see. Indeed GNU libc manual (https://www.gnu.org/software/libc/manual/html_node/Broken_002ddown-Time.html) says: timegm is rather rare. For the most portable conversion from a UTC broken-down time to a simple time, set the TZ environment variable to UTC, call mktime, then set TZ back. We have |
Just looked why we get no problems from clang reported there: We have _GNU_SOURCE already defined in that files. 'man feature_test_macros' says about it: "Since glibc 2.19, defining _GNU_SOURCE also has the effect of implicitly defining _DEFAULT_SOURCE. One of the problems is that the meaning and use of the macros is slowly changing.
Unluckily that seems to be handled differently between different compilers. Wrt adding it to src/Makefile.am. It sure needs some test but i am open for it. But maybe we should add _GNU_SOURCE instead. |
Defining say _GNU_SOURCE globally would be more manageable in my opinion than various defines scattered around in sources files. Provided of course that this covers all cases. |
To bring these to an end. I did some checks for the use of _GNU_SOURCE via Makefile.am. It looks promising. All implicit declarations are gone for actual gcc-13 and also clang 16 and 17. |
This reverts commit d754bb2312298178bcd3dd205264c81cef294af2.
Thanks! |
Will be counted as errors starting with CLANG-16