Re: Help with Rawhide build error with GCC 6.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Wakely wrote:
> A workaround would be to make it too hard for the compiler to see the
> problem:
> 
>   void* ptr = page->data;
>   _root = new (ptr) impl::xml_document_struct(page);
> 
> This way GCC doesn't see that the address refers to a 1-byte array.

Why not simply:

   char data[
#ifndef __GNUC__
             1
#endif
              ];

or:

#ifdef __GNUC__
   char data[];
#else
   char data[1];
#endif

or if you want GCC to accept this even in strict standards-compliant modes:

#ifdef __GNUC__
   __extension__ char data[];
#else
   char data[1];
#endif

?

        Kevin Kofler
--
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
http://lists.fedoraproject.org/admin/lists/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux