Skip to content

update to mingw-w64 v11.0.1 #15398

@neeraj9

Description

@neeraj9

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSolving this issue will likely involve adding new logic or components to the codebase.os-windowsMicrosoft Windows

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions