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

update to mingw-w64 v11.0.1 #15398

Closed
neeraj9 opened this issue Apr 22, 2023 · 2 comments
Closed

update to mingw-w64 v11.0.1 #15398

neeraj9 opened this issue Apr 22, 2023 · 2 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-windows
Milestone

Comments

@neeraj9
Copy link

neeraj9 commented Apr 22, 2023

I noticed a bunch of warnings with respect to -Wsingle-bit-bitfield-constant-conversion when building C code with latest zig master (4374ce5). These warnings originated from the mingw code within zig (see the snippet below).

int seen_eof : 1;

Was another way to embed mingw evaluated?

Although the runtime for this specific case is not an issue, but the incorrect code in mingw was fixed at
https://github.com/mirror/mingw-w64/blob/eff726c461e09f35eeaed125a3570fa5f807f02b/mingw-w64-crt/stdio/mingw_wvfscanf.c#L84-L94

typedef struct _IFP
{
  __extension__ union {
    void *fp;
    const wchar_t *str;
  };
  int bch[1024];
  unsigned int is_string : 1;
  int back_top;
  unsigned int seen_eof : 1;  /* changed to unsigned  from int earlier */
} _IFP;

Logs for reference

Compile C Objects [132/406] mingw_pformatw.c... D:\Work\git\ziglang\zig\stage3\lib\zig\libc\mingw\stdio\mingw_wvfscanf.c:167:17: warning: implicit truncation from 'int'
      to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
    s->seen_eof = 1;
Compile C Objects [140/406] lltow.c...                 ^ ~
D:\Work\git\ziglang\zig\stage3\lib\zig\libc\mingw\stdio\mingw_wvfscanf.c:176:22: warning: implicit truncation from 'int'
      to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
    else s->seen_eof = 1;
                     ^ ~

An interesting reference on -Wsingle-bit-bitfield-constant-conversion is at llvm/llvm-project#53253 for educational purposes.

@andrewrk andrewrk added os-windows enhancement Solving this issue will likely involve adding new logic or components to the codebase. labels Jul 23, 2023
@andrewrk andrewrk added this to the 0.11.0 milestone Jul 23, 2023
@andrewrk andrewrk changed the title need to sync to newer mingw or github submodule? update to mingw-w64 v11.0.1 Jul 23, 2023
@andrewrk
Copy link
Member

I'm working on this over at #16109

@andrewrk
Copy link
Member

andrewrk commented Jan 9, 2024

Landed in 4cf0893. Please see the PR description of #16109 for more details.

@andrewrk andrewrk closed this as completed Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-windows
Projects
None yet
Development

No branches or pull requests

2 participants