Conversation
| #else | ||
| #if !defined(_OS_WINDOWS_) || defined(_COMPILER_GCC_) | ||
| extern char **environ; | ||
| #if (!defined(_OS_WINDOWS_) || defined(_COMPILER_GCC_)) && !defined(environ) |
There was a problem hiding this comment.
What is this check? The C standard states that environ is required to be defined by the user (thus must not be a macro)
There was a problem hiding this comment.
I'm attempting to fix:
| C:/workdir/src/sys.c:500:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
| 500 \| extern char **environ;
| \| ^~~~~~
| In file included from C:/workdir/src/sys.c:8:
| C:/workdir/src/sys.c:500:15: warning: '__p__environ' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
| 500 \| extern char **environ;
| \| ^~~~~~~
but this doesn't reproduce for me locally (MinGW 11.5.0) so I don't know where this definition is coming from yet.
Presumably it's something like https://github.com/mirror/mingw-w64/blob/93f3505a758fe70e56678f00e753af3bc4f640bb/mingw-w64-headers/crt/stdlib.h#L595 ?
There was a problem hiding this comment.
Reproduces with:
// #define _POSIX_ // if uncommented, everything works
#define _UCRT
#include <stdlib.h>
extern char **environ;$ x86_64-w64-mingw32-gcc -Wstrict-prototypes -c test.c
test.c:4:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
4 | extern char **environ;
| ^~~~~~
In file included from test.c:3:
test.c:4:15: warning: ‘__p__environ’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
4 | extern char **environ;
|
maybe the right guard is defined( _POSIX_C_SOURCE )
| JLDFLAGS += -Wl,--large-address-aware | ||
| endif | ||
| JCPPFLAGS += -D_WIN32_WINNT=_WIN32_WINNT_WIN8 | ||
| JCPPFLAGS += -D_WIN32_WINNT=0x0602 # (0x0602 = _WIN32_WINNT_WIN8) |
There was a problem hiding this comment.
What's the problem with _WIN32_WINNT_WIN8? It wasn't defined at some point? If so, maybe the offending file wasn't included a header file?
There was a problem hiding this comment.
Yes, it's all over our old logs: https://buildkite.com/julialang/julia-master/builds/50748#019972b4-b648-4997-9624-70e22d7230dc/864-2038
I'm not sure why that happens, but until recently (cbea8cf) we always just used the hex code
There was a problem hiding this comment.
Make sure sdkddkver.h is included in the file which needed the macro?
There was a problem hiding this comment.
It reproduces for me with:
$ x86_64-w64-mingw32-g++ -D_WIN32_WINNT=_WIN32_WINNT_WIN8 -Wundef -c -x c++ - <<<"#include <mutex>"
<command-line>: warning: "_WIN32_WINNT_WIN8" is not defined, evaluates to 0 [-Wundef]seems like a MinGW issue
There was a problem hiding this comment.
julia> BinaryBuilderBase.runshell(Platform("x86_64", "windows"); preferred_gcc_version=v"10");
sandbox:${WORKSPACE} # echo "" | g++ -dM -E -std=c++17 -x c++ - | grep _WIN32_WINNT_WIN8
sandbox:${WORKSPACE} # echo "#include <mutex>" | g++ -dM -E -std=c++17 -x c++ - | grep _WIN32_WINNT_WIN8
sandbox:${WORKSPACE} # echo "#include <sdkddkver.h>" | g++ -dM -E -std=c++17 -x c++ - | grep _WIN32_WINNT_WIN8
#define _WIN32_WINNT_WIN8 0x0602There was a problem hiding this comment.
What should I take away from that?
There was a problem hiding this comment.
That sdkddkver.h is necessary for the macro to be defined, which is what I've been trying to say from https://github.com/JuliaLang/julia/pull/59634#discussion_r2372580441🙂
There was a problem hiding this comment.
But why should you have to include <sdkddkver.h> everywhere you use the C++ standard library?
There was a problem hiding this comment.
Ah, ok, that's because the macro is defined in the command line arguments passed everywhere.
BTW, nowadays Windows 10 is the minimum supported version.
20c5e73 to
c725965
Compare
Should fix: - `[-Wstrict-prototypes]` - `[-Wattributes]` - `[-Wc++-compat]` - `[-Wunused-but-set-variable]` - `[-Wdiscarded-qualifiers]` - `[-Wundef]` This leaves: - `[-Warray-bounds]` - `[-Winfinite-recursion]`
c725965 to
7afa2b0
Compare
Should fix: - `[-Wstrict-prototypes]` - `[-Wattributes]` - `[-Wc++-compat]` - `[-Wunused-but-set-variable]` - `[-Wdiscarded-qualifiers]` - `[-Wundef]` This leaves: - `[-Warray-bounds]` - `[-Winfinite-recursion]` see JuliaCI/julia-buildkite#484
Should fix:
[-Wstrict-prototypes][-Wattributes][-Wc++-compat][-Wunused-but-set-variable][-Wdiscarded-qualifiers][-Wundef]This leaves:
[-Warray-bounds][-Winfinite-recursion]see JuliaCI/julia-buildkite#484