-
Notifications
You must be signed in to change notification settings - Fork 362
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
Avoid macro redefined warning #3861
base: main
Are you sure you want to change the base?
Conversation
We redefines some macros on FreeBSD and OpenBSD, and it trigers some warning which may lead to failure when `-Werror` is used.
#ifdef _XOPEN_VERSION | ||
#undef _XOPEN_VERSION | ||
#endif | ||
#define _XOPEN_VERSION 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it would be better to keep original macro
#ifdef _XOPEN_VERSION | |
#undef _XOPEN_VERSION | |
#endif | |
#define _XOPEN_VERSION 0 | |
#ifndef _XOPEN_VERSION | |
#define _XOPEN_VERSION 0 | |
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, because only part of constant are missed and all of them is switched of.
Let me ping @LeeTibbert as well.
I think there was a discussion about this and we concluded that it was getting ugly so this second approach on top was followed. Perhaps a better approach to using #ifdef _PC_ALLOC_SIZE_MIN
return _PC_ALLOC_SIZE_MIN;
#else
return 0;
#endif You know, when macros get bad make another :-) |
Ok, I'll take care of this in different way. But I'd like to finish CI for BSD platform before I move. |
re: I have been offline for awhile and am about to go offline for another longish (weeks) while. My rapid "wet" reading is that section probably long predates me and has to do with I believe, but would have to re-ground myself, that XOPEN is a superset of POSIX and Compiling with _XOPEN_VERSION macro defined enabled the compilation of "intended-to-be-excluded" TL;DR - in case events need action before I can do all my evidence collection & tracing. I think the ugly but cleanest solution is to put explicit OS specific guards around the _XOPEN_VERSION That is, have the existing section for linux, MacOS (Windows?) and a new section I would end with a "Unsupported OS" #error pragma. Each OS gets what they are happy with and what has been tested & shown to work. |
On Fri, 19 Apr 2024 17:28:14 +0200, LeeTibbert wrote:
I would end with a "Unsupported OS" #error pragma.
Each OS gets what they are happy with and what has been tested & shown to work.
Feel free to push into this branch nessesary changes, and we may discuss it.
Right now no rush with it, we have plenty of time to discus the right solution.
…--
wbr, Kirill
|
We redefines some macros on FreeBSD and OpenBSD, and it trigers some warning which may lead to failure when
-Werror
is used.