Skip to content
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

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

Closed
wants to merge 11 commits into from

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Feb 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 #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
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
Copy link
Member

jay commented Feb 26, 2025

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
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