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

Mingw64 build warnings #16482

Open
p5pRT opened this issue Mar 28, 2018 · 5 comments
Open

Mingw64 build warnings #16482

p5pRT opened this issue Mar 28, 2018 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 28, 2018

Migrated from rt.perl.org#133036 (status was 'open')

Searchable as RT133036$

@p5pRT
Copy link
Author

p5pRT commented Mar 28, 2018

From @dur-randir

Created by @dur-randir

While building perl using mingw64 + dmake, I've encountered the
following compilation warnings​:

gcc -c -I.\include -I. -I.. -DWIN32 -DWIN64 -DCONSERVATIVE -DPERLDLL
-DPERL_CORE -s -O2 -fwrapv -fno-strict-aliasing -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -omini\globals.o ..\globals.c
In file included from ..\perl.h​:28​:0,
  from ..\globals.c​:32​:
./config.h​:3738​:73​: warning​: excess elements in array initializer
#define LONGDBLINFBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0xff, 0x7f, 0x00, 0x00 /**/
  ^
..\perl.h​:6728​:32​: note​: in expansion of macro 'LONGDBLINFBYTES'
INFNAN_U8_NV_DECL PL_inf = { { LONGDBLINFBYTES } };

./config.h​:3739​:91​: note​: (near initialization for 'PL_nan.u8')
#define LONGDBLNANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc0, 0xff, 0xff, 0x00, 0x00 /**/

  ^

gcc -c -I.\include -I. -I.. -DWIN32 -DWIN64 -DCONSERVATIVE -DPERLDLL
-DPERL_CORE -s -O2 -fwrapv -fno-strict-aliasing -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -omini\locale.o ..\locale.c
In file included from ..\perl.h​:5300​:0,
  from ..\locale.c​:49​:
..\locale.c​: In function 'S_my_nl_langinfo'​:
..\embed.h​:1638​:25​: warning​: ignoring return value of
'S_save_to_buffer', declared with attribute warn_unused_result
[-Wunused-result]
#define save_to_buffer S_save_to_buffer
..\embed.h​:1638​:25​: note​: in definition of macro 'save_to_buffer'
#define save_to_buffer S_save_to_buffer
  ^~~~~~~~~~~~~~~~

gcc -c -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE
-DPERL_TEXTMODE_SCRIPTS -fwrapv -fno-strict-aliasing -mms-bitfields
-DPERLDLL -s -O2 -DVERSION=\"3.39\" -DXS_VERSION=\"3.39\"
"-I..\.
lib\CORE" RealPPPort.c
In file included from RealPPPort.xs​:31​:0​:
RealPPPort.xs​: In function 'XS_Devel__PPPort_ptrtests'​:
..\..\lib\CORE/perl.h​:1729​:26​: warning​: cast from pointer to integer
of different size [-Wpointer-to-int-cast]
# define INT2PTR(any,d) (any)(d)
  ^
..\..\lib\CORE/perl.h​:1742​:21​: note​: in expansion of macro 'INT2PTR'
# define PTR2ul(p) INT2PTR(unsigned long,p)
  ^~~~~~~
RealPPPort.xs​:1650​:27​: note​: in expansion of macro 'PTR2ul'
  RETVAL += PTR2ul(p) != 0UL ? 2 : 0;
  ^

gcc -c -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE
-DPERL_TEXTMODE_SCRIPTS -fwrapv -fno-strict-aliasing -mms-bitfields
-DPERLDLL -s -O2 -DVERSION=\"3.06\" -DXS_VERSION=\"3
lib\CORE" Storable.c
Storable.xs​: In function 'known_class'​:
Storable.xs​:570​:31​: warning​: cast from pointer to integer of different
size [-Wpointer-to-int-cast]
#define LOW_32BITS(x) ((I32) ((unsigned long) (x) & 0xffffffffUL))
  ^
Storable.xs​:2309​:21​: note​: in expansion of macro 'LOW_32BITS'
  *classnum = LOW_32BITS(*svh);
  ^
Storable.xs​: In function 'store_scalar'​:
Storable.xs​:644​:6​: warning​: cast from pointer to integer of different
size [-Wpointer-to-int-cast]
  ((unsigned long) (x) == trunc_int(x))
  ^
Storable.xs​:804​:13​: note​: in expansion of macro 'int_aligned'
  if (int_aligned(mptr)) \
  ^~~~~~~~~~~
Storable.xs​:1028​:13​: note​: in expansion of macro 'MBUF_PUTINT'
  MBUF_PUTINT(x); \
  ^~~~~~~~~~~
Storable.xs​:2535​:13​: note​: in expansion of macro 'WRITE_I32'
  WRITE_I32(niv);
  ^
Storable.xs​:644​:6​: warning​: cast from pointer to integer of different
size [-Wpointer-to-int-cast]
  ((unsigned long) (x) == trunc_int(x))
  ^
Storable.xs​:804​:13​: note​: in expansion of macro 'int_aligned'
  if (int_aligned(mptr)) \
  ^~~~~~~~~~~
Storable.xs​:1051​:17​: note​: in expansion of macro 'MBUF_PUTINT'
  MBUF_PUTINT(y); \
  ^~~~~~~~~~~
Storable.xs​:1126​:13​: note​: in expansion of macro 'WLEN'
  WLEN(ilen); \
  ^~~~
Storable.xs​:2603​:13​: note​: in expansion of macro 'STORE_PV_LEN'
  STORE_PV_LEN((const char *)mg->mg_ptr,
  ^
Storable.xs​:644​:6​: warning​: cast from pointer to integer of different
size [-Wpointer-to-int-cast]
  ((unsigned long) (x) == trunc_int(x))
  ^
Storable.xs​:804​:13​: note​: in expansion of macro 'int_aligned'
  if (int_aligned(mptr)) \
  ^~~~~~~~~~~
Storable.xs​:1051​:17​: note​: in expansion of macro 'MBUF_PUTINT'
  MBUF_PUTINT(y); \
  ^~~~~~~~~~~
Storable.xs​:1126​:13​: note​: in expansion of macro 'WLEN'
  WLEN(ilen); \
  ^~~~
Storable.xs​:304​:32​: note​: in expansion of macro 'STORE_PV_LEN'
#define STORE_UTF8STR(pv, len) STORE_PV_LEN(pv, len, SX_UTF8STR, SX_LUTF8STR)
  ^~~~~~~~~~~~
Storable.xs​:2610​:13​: note​: in expansion of macro 'STORE_UTF8STR'
  STORE_UTF8STR(pv, wlen);
  ^
Storable.xs​:642​:23​: warning​: cast from pointer to integer of different
size [-Wpointer-to-int-cast]
  ((unsigned long) ((unsigned long) (x) & ~(sizeof(int)-1)))
  ^
Storable.xs​:644​:29​: note​: in expansion of macro 'trunc_int'
  ((unsigned long) (x) == trunc_int(x))
  ^~~~~~~~~
Storable.xs​:804​:13​: note​: in expansion of macro 'int_aligned'
  if (int_aligned(mptr)) \
  ^~~~~~~~~~~
Storable.xs​:1051​:17​: note​: in expansion of macro 'MBUF_PUTINT'
  MBUF_PUTINT(y); \
  ^~~~~~~~~~~
Storable.xs​:1126​:13​: note​: in expansion of macro 'WLEN'
  WLEN(ilen); \
  ^~~~
Storable.xs​:1131​:31​: note​: in expansion of macro 'STORE_PV_LEN'
#define STORE_SCALAR(pv, len) STORE_PV_LEN(pv, len, SX_SCALAR, SX_LSCALAR)
  ^~~~~~~~~~~~
Storable.xs​:2612​:13​: note​: in expansion of macro 'STORE_SCALAR'
  STORE_SCALAR(pv, wlen);
  ^
Storable.xs​: In function 'old_retrieve_hash'​:
Storable.xs​:644​:6​: warning​: cast from pointer to integer of different
size [-Wpointer-to-int-cast]
  ((unsigned long) (x) == trunc_int(x))
  ^
Storable.xs​:742​:17​: note​: in expansion of macro 'int_aligned'
  if (int_aligned(mptr)) \
  ^~~~~~~~~~~
Storable.xs​:1176​:13​: note​: in expansion of macro 'MBUF_GETINT'
  MBUF_GETINT(x); \
  ^~~~~~~~~~~
Storable.xs​:6930​:5​: note​: in expansion of macro 'RLEN'
  RLEN(len);

Note that for Storable, I've copied just some instances of each
warning type - they all seem to have the same cause, so I saw no
additional information in copying them all.

Generating a dmake-style Makefile
Writing Makefile for Errno
"..\..\miniperl.exe" "-I..\..\lib" Errno_pm.PL Errno.pm
In file included from includes.c​:4​:0​:
c​:/MinGW/mingw64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/avx5124vnniwintrin.h​:25​:3​:
error​: #error "Never use <avx5124vnniwintrin.h> directly; include
<x86intrin.h> instead."
# error "Never use <avx5124vnniwintrin.h> directly; include
<x86intrin.h> instead."

perlhost.h​: In function 'CPerlHost* IPerlProc2Host(IPerlProc*)'​:
perlhost.h​:230​:63​: warning​: offsetof within non-standard-layout type
'CPerlHost' is undefined [-Winvalid-offsetof]
#define STRUCT2RAWPTR(x, y) (CPerlHost*)(((LPBYTE)x)-offsetof(CPerlHost, y))
  ^
perlhost.h​:237​:38​: note​: in expansion of macro 'STRUCT2RAWPTR'
#define STRUCT2PTR(x, y) CheckInterp(STRUCT2RAWPTR(x, y))
  ^~~~~~~~~~~~~
perlhost.h​:284​:12​: note​: in expansion of macro 'STRUCT2PTR'
  return STRUCT2PTR(piPerl, m_hostperlProc);
  ^

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl 5.27.10:

Configured by dur-randir at Wed Mar 28 01:45:22 2018.

Summary of my perl5 (revision 5 version 27 subversion 10) configuration:

  Platform:
    osname=MSWin32
    osvers=6.1.7601
    archname=MSWin32-x64-perlio
    uname=''
    config_args='undef'
    hint=recommended
    useposix=true
    d_sigaction=undef
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=undef
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='gcc'
    ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE
-DPERL_TEXTMODE_SCRIPTS -fwrapv -fno-strict-aliasing -mms-bitfields'
    optimize='-s -O2'
    cppflags='-DWIN32'
    ccversion=''
    gccversion='7.3.0'
    gccosandvers=''
    intsize=4
    longsize=4
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='long long'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='g++'
    ldflags ='-s -L"c:\perl\lib\CORE" -L"C:\MinGW\mingw64\lib"'
    libpth=C:\MinGW\mingw64\lib
    libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
-ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32
-lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool
-lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid
-lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    libc=
    so=dll
    useshrplib=true
    libperl=libperl527.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs
    dlext=dll
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags=' '
    lddlflags='-mdll -s -L"c:\perl\lib\CORE" -L"C:\MinGW\mingw64\lib"'



@INC for perl 5.27.10:
    C:\perl-git-false\lib
    C:\perl-git-false\cpan\AutoLoader\lib
    C:\perl-git-false\dist\Carp\lib
    C:\perl-git-false\dist\PathTools
    C:\perl-git-false\dist\PathTools\lib
    C:\perl-git-false\cpan\ExtUtils-Install\lib
    C:\perl-git-false\cpan\ExtUtils-MakeMaker\lib
    C:\perl-git-false\cpan\ExtUtils-Manifest\lib
    C:\perl-git-false\cpan\File-Path\lib
    C:\perl-git-false\ext\re
    C:\perl-git-false\dist\Term-ReadLine\lib
    C:\perl-git-false\dist\Exporter\lib
    C:\perl-git-false\ext\File-Find\lib
    C:\perl-git-false\cpan\Text-Tabs\lib
    C:\perl-git-false\dist\constant\lib
    C:\perl-git-false\cpan\version\lib
    C:\perl-git-false\cpan\Text-ParseWords\lib
    C:\perl-git-false\dist\ExtUtils-ParseXS\lib
    C:\perl-git-false\cpan\Getopt-Long\lib
    C:\perl-git-false\cpan\parent\lib
    C:\perl-git-false\cpan\ExtUtils-Constant\lib


Environment for perl 5.27.10:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\perl\bin;C:\Program
Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows
Kits\10\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL
Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft
SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL
Server\120\Tools\Binn\;C:\Program
Files\Git\cmd;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files\PowerShell\6.0.1\;:c:\mingw\bin;c:\mingw\bin;c:\MinGW\mingw64\bin;c:\dmake
    PERL_BADLANG (unset)
    SHELL (unset)

@p5pRT
Copy link
Author

p5pRT commented Apr 9, 2018

From @tonycoz

On Tue, 27 Mar 2018 17​:41​:14 -0700, randir wrote​:

While building perl using mingw64 + dmake, I've encountered the
following compilation warnings​:

This should be fixed by 59bc72e.

Tony

@p5pRT
Copy link
Author

p5pRT commented Apr 9, 2018

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Apr 10, 2018

From @dur-randir

On Sun, 08 Apr 2018 21​:03​:52 -0700, tonyc wrote​:

This should be fixed by 59bc72e.

The Storable ones are gone, but all other are still present.

@khwilliamson
Copy link
Contributor

Is this fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants