Compile warning on ucrt build of mingw

35 views
Skip to first unread message

John Marriott

unread,
Apr 16, 2022, 5:49:08 PM4/16/22
to vim...@googlegroups.com
I recently started using a ucrt enabled build of mingw64 (gcc 11.2.0)
which gives me this compile warning:
<snip>
gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603
-DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO
-pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return
-fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD evalfunc.c -o
gobjnative/evalfunc.o
In file included from os_win32.h:77,
                 from vim.h:279,
                 from evalfunc.c:15:
evalfunc.c: In function 'f_environ':
evalfunc.c:3679:27: warning: '__p__environ' redeclared without dllimport
attribute: previous dllimport ignored [-Wattributes]
 3679 |     extern char         **environ;
      |                           ^~~~~~~
</snip>

The attach patch seems to fix it.

Cheers
John
evalfunc.c.8.2.4768.patch

Bram Moolenaar

unread,
Apr 17, 2022, 5:58:55 AM4/17/22
to vim...@googlegroups.com, John Marriott
Hmm, the warning is for __p__environ, while it points to "environ", and
the added #ifdef removes the extern for _wenviron. Confusing, but if
this works, then fine.

--
hundred-and-one symptoms of being an internet addict:
2. You kiss your girlfriend's home page.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

John Marriott

unread,
Apr 17, 2022, 6:09:04 PM4/17/22
to vim...@googlegroups.com

On 17-Apr-2022 19:58, Bram Moolenaar wrote:
> John Marriott wrote:
>
>> I recently started using a ucrt enabled build of mingw64 (gcc 11.2.0)
>> which gives me this compile warning:
>> <snip>
>> gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603
>> -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO
>> -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return
>> -fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD evalfunc.c -o
>> gobjnative/evalfunc.o
>> In file included from os_win32.h:77,
>>                  from vim.h:279,
>>                  from evalfunc.c:15:
>> evalfunc.c: In function 'f_environ':
>> evalfunc.c:3679:27: warning: '__p__environ' redeclared without dllimport
>> attribute: previous dllimport ignored [-Wattributes]
>>  3679 |     extern char         **environ;
>>       |                           ^~~~~~~
>> </snip>
>>
>> The attach patch seems to fix it.
> Hmm, the warning is for __p__environ, while it points to "environ", and
> the added #ifdef removes the extern for _wenviron. Confusing, but if
> this works, then fine.
>
Hi Bram,

Patch 8.2.4769 fixes it, thanks.

Happy Easter!
Reply all
Reply to author
Forward
0 new messages