Skip to content

build: silence mingw32ce C99 format warnings, simplify CI - #16492

Closed
vszakats wants to merge 11 commits into
curl:masterfrom
vszakats:ce99fmt
Closed

vszakats wants to merge 11 commits into
curl:masterfrom
vszakats:ce99fmt

Conversation

@vszakats

@vszakats vszakats commented Feb 26, 2025 •

Copy link
Copy Markdown
Member

./configure mingw32ce builds enable C99 mode automatically, that
triggers compiler warnings in gcc 4.4.0. We initially worked it around
in CI by suppressing the detection of C99 with ac_cv_prog_cc_c99=no.

Replace it with automatically silencing the bogus warnings in C99 mode,
for all build systems:

lib/ftp.c: In function 'Curl_GetFTPResponse':
lib/ftp.c:726: error: format '%zd' expects type 'signed size_t', but argument 4 has type 'ssize_t'
lib/ws.c: In function 'ws_dec_pass_payload':
lib/ws.c:304: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/ws.c: In function 'ws_enc_write_head':
lib/ws.c:581: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int'
lib/vtls/schannel.c: In function 'schannel_connect_step1':
lib/vtls/schannel.c:1122: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c: In function 'schannel_connect_step2':
lib/vtls/schannel.c:1311: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c: In function 'schannel_send':
lib/vtls/schannel.c:1793: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c:1810: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c: In function 'schannel_shutdown':                         
lib/vtls/schannel.c:2286: error: format '%zd' expects type 'signed size_t', but argument 4 has type 'ssize_t'
lib/vtls/vtls.c: In function 'ssl_cf_recv':                                   
lib/vtls/vtls.c:1422: error: format '%zd' expects type 'signed size_t', but argument 5 has type 'ssize_t'

Ref: https://github.com/curl/curl/actions/runs/13533841306/job/37821720902?pr=16492#step:9:20

Also: simplify Windows CE job configuration in GHA/windows.

Follow-up to 2a292c3 #15975

@vszakats
vszakats marked this pull request as draft February 26, 2025 00:34
@github-actions github-actions Bot added Windows Windows-specific CI Continuous Integration labels Feb 26, 2025
@vszakats

This comment was marked as duplicate.

@vszakats

Copy link
Copy Markdown
Member Author

After silencing the bogus WinCE warnings, the next question is why does autotools want to detect C11 and C99 in these builds, and not in others:

checking whether /Users/runner/opt/mingw32ce/bin/arm-mingw32ce-gcc accepts -g... yes
checking for /Users/runner/opt/mingw32ce/bin/arm-mingw32ce-gcc option to enable C11 features... unsupported
checking for /Users/runner/opt/mingw32ce/bin/arm-mingw32ce-gcc option to enable C99 features... -std=gnu99
checking whether /Users/runner/opt/mingw32ce/bin/arm-mingw32ce-gcc -std=gnu99 understands -c and -o together... yes

https://github.com/curl/curl/actions/runs/13534146058/job/37822577315?pr=16492#step:6:74

vs. a normal mingw builds:

checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes

https://github.com/curl/curl/actions/runs/13534146058/job/37822579122?pr=16492#step:7:73

@vszakats vszakats changed the title hit the gcc 4.4.0 C99 fmt bogus warning build: silence bogus gcc C99 format warnings with mingw32ce Feb 26, 2025
@vszakats vszakats changed the title build: silence bogus gcc C99 format warnings with mingw32ce build: silence bogus mingw32ce C99 format warnings, simplify CI Feb 26, 2025
@vszakats
vszakats marked this pull request as ready for review February 26, 2025 03:04
@vszakats vszakats changed the title build: silence bogus mingw32ce C99 format warnings, simplify CI build: silence mingw32ce C99 format warnings, simplify CI Feb 26, 2025
@jay

jay commented Feb 26, 2025

Copy link
Copy Markdown
Member

After silencing the bogus WinCE warnings, the next question is why does autotools want to detect C11 and C99 in these builds, and not in others

There's probably something legacy in the compiler that it detects (or, can't detect..) and so it needs to interrogate more than usual. I wouldn't sweat it.

@vszakats vszakats closed this in 3efc53f Feb 26, 2025
@vszakats
vszakats deleted the ce99fmt branch February 26, 2025 11:38
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
`./configure` mingw32ce builds enable C99 mode automatically, that
triggers compiler warnings in gcc 4.4.0. We initially worked it around
in CI by suppressing the detection of C99 with `ac_cv_prog_cc_c99=no`.

Replace it with automatically silencing the bogus warnings in C99 mode,
for all build systems:
```
lib/ftp.c: In function 'Curl_GetFTPResponse':
lib/ftp.c:726: error: format '%zd' expects type 'signed size_t', but argument 4 has type 'ssize_t'
lib/ws.c: In function 'ws_dec_pass_payload':
lib/ws.c:304: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/ws.c: In function 'ws_enc_write_head':
lib/ws.c:581: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int'
lib/vtls/schannel.c: In function 'schannel_connect_step1':
lib/vtls/schannel.c:1122: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c: In function 'schannel_connect_step2':
lib/vtls/schannel.c:1311: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c: In function 'schannel_send':
lib/vtls/schannel.c:1793: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c:1810: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c: In function 'schannel_shutdown':
lib/vtls/schannel.c:2286: error: format '%zd' expects type 'signed size_t', but argument 4 has type 'ssize_t'
lib/vtls/vtls.c: In function 'ssl_cf_recv':
lib/vtls/vtls.c:1422: error: format '%zd' expects type 'signed size_t', but argument 5 has type 'ssize_t'
```
Ref: https://github.com/curl/curl/actions/runs/13533841306/job/37821720902?pr=16492#step:9:20

Also: simplify Windows CE job configuration in GHA/windows.

Follow-up to 2a292c3 curl#15975
Closes curl#16492
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

2 participants