Re: Help needed with wxWidgets3.1 tests compilation error

2022-01-21 Thread Hamish McIntyre-Bhatty

On 20/01/2022 20:38, Brian Inglis wrote:

On 2022-01-20 10:10, Hamish McIntyre-Bhatty wrote:
I've been having trouble compiling the unit tests for 
wxWidgets3.1-3.1.5 on Cygwin. The same tests build just fine on my 
Linux Mint 20.3 install, however that is using GCC 9.3.0 instead of 
Cygwin's 11.2.0.


Attached is the full build log, but I will also point out my ideas 
about particular issues here.


Note: -Werror=format-security is used in the Makefile. I couldn't find 
exactly what this does, but I'm probably looking in the wrong place - 
the manpage. Perhaps the following could also be explained by 
differences from GCC 9 to 11?


I check first as in `info GCC Wformat-security` should only care about 
*printf string variables without using a separate format string.



Ah okay, I guess that doesn't explain the 
-Werror=zero-as-null-pointer-constant errors later. I guess that might 
be a GCC default change.





The first is:

In file included from /usr/include/unistd.h:4,
  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/filefn.h:23, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/utils.h:20, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/cursor.h:75, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/event.h:22, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/evtloop.h:14, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/testprec.h:5, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/allheaders.cpp:433: 

/usr/include/sys/unistd.h:23:9: error: redundant redeclaration of ‘int 
chmod(const char*, mode_t)’ in same scope [-Werror=redundant-decls]

    23 | int chmod (const char *__path, mode_t __mode);
   | ^
In file included from /usr/include/sys/_default_fcntl.h:211,
  from /usr/include/sys/fcntl.h:3,
  from /usr/include/fcntl.h:12,
  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/allheaders.cpp:83: 

/usr/include/sys/stat.h:137:9: note: previous declaration of ‘int 
chmod(const char*, mode_t)’

   137 | int chmod (const char *__path, mode_t __mode );
   | ^

This doesn't happen on my Linux Mint 20.3 (Ubuntu 20.04) host, so I'm 
assuming this is something to do with the standard library?


Next is:

In file included from /usr/include/unistd.h:4,
  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/filefn.h:23, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/utils.h:20, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/cursor.h:75, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/event.h:22, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/evtloop.h:14, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/testprec.h:5, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/allheaders.cpp:433: 

/usr/include/sys/unistd.h:179:9: error: redundant redeclaration of 
‘int pthread_atfork(void (*)(), void (*)(), void (*)())’ in same scope 
[-Werror=redundant-decls]
   179 | int pthread_atfork (void (*)(void), void (*)(void), void 
(*)(void));

   | ^~
In file included from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/x86_64-pc-cygwin/bits/gthr-default.h:35, 

  from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/x86_64-pc-cygwin/bits/gthr.h:148, 

  from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/ext/atomicity.h:35,
  from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/ios_base.h:39,
  from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/iomanip:40,
  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/allheaders.cpp:63: 

/usr/include/pthread.h:65:5: note: previous declaration of ‘int 
pthread_atfork(void (*)(), void (*)(), void (*)())’
    65 | int pthread_atfork (void (*)(void), void (*)(void), void 
(*)(void));

   | ^~

Ditto.


Looking at chmod(3p), pthread_atfork(3p), pthread.h(0p) sys_stat.h(0p), 
unistd.h(0p) those definitions should *NOT* normally be accessible from 
unistd.h so there should be no conflict, as POSIX specifies what is 
visible.
Perhaps they are there for compatibility with older systems like BSD or 

Re: Help needed with wxWidgets3.1 tests compilation error

2022-01-20 Thread Brian Inglis

On 2022-01-20 10:10, Hamish McIntyre-Bhatty wrote:
I've been having trouble compiling the unit tests for wxWidgets3.1-3.1.5 
on Cygwin. The same tests build just fine on my Linux Mint 20.3 install, 
however that is using GCC 9.3.0 instead of Cygwin's 11.2.0.


Attached is the full build log, but I will also point out my ideas about 
particular issues here.


Note: -Werror=format-security is used in the Makefile. I couldn't find 
exactly what this does, but I'm probably looking in the wrong place - 
the manpage. Perhaps the following could also be explained by 
differences from GCC 9 to 11?


I check first as in `info GCC Wformat-security` should only care about 
*printf string variables without using a separate format string.



The first is:

In file included from /usr/include/unistd.h:4,
  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/filefn.h:23, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/utils.h:20, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/cursor.h:75, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/event.h:22, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/evtloop.h:14, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/testprec.h:5, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/allheaders.cpp:433: 

/usr/include/sys/unistd.h:23:9: error: redundant redeclaration of ‘int 
chmod(const char*, mode_t)’ in same scope [-Werror=redundant-decls]

    23 | int chmod (const char *__path, mode_t __mode);
   | ^
In file included from /usr/include/sys/_default_fcntl.h:211,
  from /usr/include/sys/fcntl.h:3,
  from /usr/include/fcntl.h:12,
  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/allheaders.cpp:83: 

/usr/include/sys/stat.h:137:9: note: previous declaration of ‘int 
chmod(const char*, mode_t)’

   137 | int chmod (const char *__path, mode_t __mode );
   | ^

This doesn't happen on my Linux Mint 20.3 (Ubuntu 20.04) host, so I'm 
assuming this is something to do with the standard library?


Next is:

In file included from /usr/include/unistd.h:4,
  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/filefn.h:23, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/utils.h:20, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/cursor.h:75, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/event.h:22, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/evtloop.h:14, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/testprec.h:5, 

  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/allheaders.cpp:433: 

/usr/include/sys/unistd.h:179:9: error: redundant redeclaration of ‘int 
pthread_atfork(void (*)(), void (*)(), void (*)())’ in same scope 
[-Werror=redundant-decls]
   179 | int pthread_atfork (void (*)(void), void (*)(void), void 
(*)(void));

   | ^~
In file included from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/x86_64-pc-cygwin/bits/gthr-default.h:35, 

  from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/x86_64-pc-cygwin/bits/gthr.h:148, 

  from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/ext/atomicity.h:35,
  from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/ios_base.h:39,
  from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/iomanip:40,
  from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/allheaders.cpp:63: 

/usr/include/pthread.h:65:5: note: previous declaration of ‘int 
pthread_atfork(void (*)(), void (*)(), void (*)())’
    65 | int pthread_atfork (void (*)(void), void (*)(void), void 
(*)(void));

   | ^~

Ditto.


Looking at chmod(3p), pthread_atfork(3p), pthread.h(0p) sys_stat.h(0p), 
unistd.h(0p) those definitions should *NOT* normally be accessible from 
unistd.h so there should be no conflict, as POSIX specifies what is 
visible.
Perhaps they are there for compatibility with older systems like BSD or 
Solaris and should be suppressed when newer feature macros are defined 
or specific legacy system macros are not defined?


Also of note, is that Cygwin is several times slower at 

Help needed with wxWidgets3.1 tests compilation error

2022-01-20 Thread Hamish McIntyre-Bhatty

Hi there,

I've been having trouble compiling the unit tests for wxWidgets3.1-3.1.5 
on Cygwin. The same tests build just fine on my Linux Mint 20.3 install, 
however that is using GCC 9.3.0 instead of Cygwin's 11.2.0.


Attached is the full build log, but I will also point out my ideas about 
particular issues here.


Note: -Werror=format-security is used in the Makefile. I couldn't find 
exactly what this does, but I'm probably looking in the wrong place - 
the manpage. Perhaps the following could also be explained by 
differences from GCC 9 to 11?


The first is:

In file included from /usr/include/unistd.h:4,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/filefn.h:23,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/utils.h:20,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/cursor.h:75,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/event.h:22,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/evtloop.h:14,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/testprec.h:5,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/allheaders.cpp:433:
/usr/include/sys/unistd.h:23:9: error: redundant redeclaration of ‘int 
chmod(const char*, mode_t)’ in same scope [-Werror=redundant-decls]

   23 | int chmod (const char *__path, mode_t __mode);
  | ^
In file included from /usr/include/sys/_default_fcntl.h:211,
 from /usr/include/sys/fcntl.h:3,
 from /usr/include/fcntl.h:12,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/allheaders.cpp:83:
/usr/include/sys/stat.h:137:9: note: previous declaration of ‘int 
chmod(const char*, mode_t)’

  137 | int chmod (const char *__path, mode_t __mode );
  | ^

This doesn't happen on my Linux Mint 20.3 (Ubuntu 20.04) host, so I'm 
assuming this is something to do with the standard library?


Next is:

In file included from /usr/include/unistd.h:4,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/filefn.h:23,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/utils.h:20,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/cursor.h:75,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/event.h:22,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/include/wx/evtloop.h:14,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/testprec.h:5,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/allheaders.cpp:433:
/usr/include/sys/unistd.h:179:9: error: redundant redeclaration of ‘int 
pthread_atfork(void (*)(), void (*)(), void (*)())’ in same scope 
[-Werror=redundant-decls]
  179 | int pthread_atfork (void (*)(void), void (*)(void), void 
(*)(void));

  | ^~
In file included from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/x86_64-pc-cygwin/bits/gthr-default.h:35,
 from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/x86_64-pc-cygwin/bits/gthr.h:148,
 from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/ext/atomicity.h:35,
 from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/ios_base.h:39,
 from 
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/iomanip:40,
 from 
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/src/wxWidgets-3.1.5/tests/allheaders.cpp:63:
/usr/include/pthread.h:65:5: note: previous declaration of ‘int 
pthread_atfork(void (*)(), void (*)(), void (*)())’
   65 | int pthread_atfork (void (*)(void), void (*)(void), void 
(*)(void));

  | ^~

Ditto.

Then there are some wxwidgets-specific ones, but I'll make a separate 
thread for those because I have an idea about what might be causing 
them. I'll probably need to ask the wxWidgets people.


Hopefully someone here with more experience can help.

Also of note, is that Cygwin is several times slower at compiling pretty 
much everything for me. Does anyone know if this is GCC 9 vs 11 speed, 
or running Cygwin in Windows 11 in KVM, or something else? I am running 
on AMD Ryzen 3000, if that has anything to do with it.


Hamish
/home/Hamis/wxwidgets3.1/wxWidgets3.1-3.1.5-1.x86_64/build/gtk2/bk-deps g++ -c 
-o test_allheaders_allheaders.o