Fix compilation errors with libstdc++v3 for AVR target and allow --enable-libstdcxx
Jonathan Wakely
jwakely@redhat.com
Tue Dec 6 18:45:00 GMT 2016
On 16/09/16 02:53 -0300, Felipe Magno de Almeida wrote:
>On Fri, Sep 16, 2016 at 2:42 AM, Marc Glisse <marc.glisse@inria.fr> wrote:
>> On Thu, 15 Sep 2016, Felipe Magno de Almeida wrote:
>>
>> + || sizeof(uint32_t) == sizeof(void*)
>> + || sizeof(uint16_t) == sizeof(void*),
>>
>> Indentation is off?
>>
>>> Call _M_extract_* functions family through temporary int objects
>>
>>
>> Would it make sense to use a template type instead of int for this
>> parameter? Or possibly have a typedef that defaults to int (what POSIX
>> requires). The hard case would be a libc that uses bitfields for the fields
>> of struct tm (that could save some space), but I don't think anyone does
>> that.
>
>I've tried both approaches. Templates were causing problems of not
>defined instantations because they were being used as ints too
>in other _M_extract functions through a tmp integer. And typedef's
>caused the same problem of having to use a tmp value of the right
>type but for example _M_extract_wday_or_month could not have the
>same type (in AVR they do) and I'd have to use a temporary anyway
>then.
>
>This was the least intrusive way.
Did you consider something like this?
This should have no overhead for the targets with standard conforming
struct tm, and only uses a temporary variable and additional
assignments for AVR.
It's ugly though.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 5221 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20161206/c35c6a01/attachment.bin>
More information about the Libstdc++
mailing list