List:MySQL++« Previous MessageNext Message »
From:Tomalak Geret'kal Date:February 12 2011 5:40pm
Subject:Re: Fix for GCC 4.6
View as plain text  
On 11/02/2011 18:38, Jonathan Wakely wrote:
> On 11 February 2011 18:30, Remi Collet wrote:
>>
>> Hi,
>>
>> During fedora 15 mass rebuild, mysql++ fails to build because of some
>> changes in new GCC 4.6.
>>
>> In file included from ./lib/sql_buffer.h:31:0,
>>                  from ./lib/sql_buffer.cpp:26:
>> ./lib/refcounted.h:258:2: error: 'size_t' does not name a type
>>
>>
>>  From GCC documentation:
>>
>>         STL headers not including<cstddef>  any longer
>>
>> 2 solutions :
>>         - include<cstddef>
>>         - use std::size_t
>
> std::size_t is defined by<cstddef>, so the correct fix if you want to
> use size_t is to explicitly include either<stddef.h>  (for ::size_t)
> or<cstddef>  (for std::size_t)
>
> Otherwise some other change to the Standard Library could cause the
> same problem again.  If you use a type, include the header that
> declares it.
>

Jonathan,

Isn't that what Remi said? I believe his two solutions were 
to be employed simultaneously, not as an "either/or" set of 
options. It would certainly make sense.

Also, actually, including stddef.h brings the symbols into 
the `std` namespace *and* the global namespace. See D.5 in 2003.

cstddef is indeed preferred, though.

Tom
Thread
Fix for GCC 4.6Remi Collet11 Feb
  • Re: Fix for GCC 4.6Jonathan Wakely11 Feb
    • Re: Fix for GCC 4.6Jonathan Wakely11 Feb
    • Re: Fix for GCC 4.6Tomalak Geret'kal12 Feb
      • Re: Fix for GCC 4.6Jonathan Wakely12 Feb
        • Re: Fix for GCC 4.6Tomalak Geret'kal12 Feb
          • Re: Fix for GCC 4.6Mickael Wolff14 Feb
            • Re: Fix for GCC 4.6Tomalak Geret'kal14 Feb
    • Re: Fix for GCC 4.6Warren Young19 Feb