public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
* Errors building cygwin with latest gcc
@ 2021-08-25 22:03 Ken Brown
  0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2021-08-25 22:03 UTC (permalink / raw)
  To: cygwin-devel

With the recently uploaded gcc-11.2.0, I'm seeing three types of errors when 
building cygwin:

1.  In file included from ../../../../../newlib-cygwin/winsup/utils/mingw/path.cc:1:
../../../../../newlib-cygwin/winsup/utils/mingw/../path.cc: In function ‘char* 
conv_fstab_spaces(char*)’:
../../../../../newlib-cygwin/winsup/utils/mingw/../path.cc:286:18: error: ISO 
C++17 does not allow ‘register’ storage class specifier [-Werror=register]
   286 |   register char *sp = field;

Removing all the 'register' specifiers fixes these and I guess is harmless.

2. In member function ‘int dumper::dump_module(asection*, process_module*)’,
     inlined from ‘int dumper::dump_module(asection*, process_module*)’ at 
../../../../newlib-cygwin/winsup/utils/dumper.cc:533:1:
../../../../newlib-cygwin/winsup/utils/dumper.cc:562:11: error: ‘char* 
strncpy(char*, const char*, size_t)’ writing 16 bytes into a region of size 1 
overflows the destination [-Werror=stringop-overflow=]
   562 |   strncpy (header.elf_note_header.name, "win32module", NOTE_NAME_SIZE);
       |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../../newlib-cygwin/winsup/utils/dumper.cc:25:
../../../../newlib-cygwin/winsup/../include/elf/external.h: In member function 
‘int dumper::dump_module(asection*, process_module*)’:
../../../../newlib-cygwin/winsup/../include/elf/external.h:169:17: note: 
destination object ‘Elf_External_Note::name’ of size 1
   169 |   char          name[1];                /* Start of the name+desc data */

The code contains

#pragma GCC diagnostic ignored "-Wstringop-overflow"

which should have prevented that error, shouldn't it?

3. ../../../../newlib-cygwin/winsup/cygwin/miscfuncs.cc: In member function 
‘void* thread_allocator::_alloc(SIZE_T)’:
../../../../newlib-cygwin/winsup/cygwin/miscfuncs.cc:522:5: error: 
‘MEM_EXTENDED_PARAMETER::<unnamed struct>’ has no non-static data member named 
‘Pointer’
   522 |     };

This one completely mystifies me, given the definition of MEM_EXTENDED_PARAMETER 
in /usr/include/w32api/winnt.h.  Is there some problem with the use of an 
unnamed struct and unnamed union in that definition?

Ken

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-25 22:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 22:03 Errors building cygwin with latest gcc Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).