I did this
3 source files in 8.19.0 got added
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored …
directives, only wrapping it in a basic check for __GNUC__. This breaks compilation in ancient versions of GCC with an error of #pragma GCC diagnostic not allowed inside functions.
It isn't clear to me from past issues like #16062 or #16152 on what was ultimately decided on supporting such old compilers. I'm filing this issue then since:
- those previous issues were corrected
- curl is a stickler for requiring nothing newer than C89, and even GCC 4.2 was a C99-capable compiler
- simple enough, if wordy, to extend the check for the correct version:
(defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)))
The newly affected files in 8.19.0:
lib/mprintf.c inside function out_double()
src/tool_cb_prg.c inside function tool_progress_cb()
src/tool_writeout.c inside function outtime()
I expected the following
No response
curl/libcurl version
curl 8.19.0
operating system
n/a
I did this
3 source files in 8.19.0 got added
directives, only wrapping it in a basic check for
__GNUC__. This breaks compilation in ancient versions of GCC with an error of#pragma GCC diagnostic not allowed inside functions.It isn't clear to me from past issues like #16062 or #16152 on what was ultimately decided on supporting such old compilers. I'm filing this issue then since:
(defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)))The newly affected files in 8.19.0:
lib/mprintf.cinside functionout_double()src/tool_cb_prg.cinside functiontool_progress_cb()src/tool_writeout.cinside functionouttime()I expected the following
No response
curl/libcurl version
curl 8.19.0
operating system
n/a