[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: gcc4 warnings -Wuninitialized -Wfloat-equal and -Wconversion
From:       Jaime <jtamate () gmail ! com>
Date:       2009-09-23 7:48:23
Message-ID: 27962acd0909230048n34d7f9f1ja483df7ebbca728f () mail ! gmail ! com
[Download RAW message or body]

2009/9/23 Thiago Macieira <thiago@kde.org>:
> Em Terça-feira 22. Setembro 2009, às 22.18.08, Jaime Torres escreveu:
>> using a struct like this:
>>
>> typedef enum {
>>         LeftToRight,
>>         RightToLeft
>> } LayoutDirection_T;
>>
>> typedef struct
>> {
>>         LayoutDirection_T b:1;
>> }
>> LayoutDirection;
>>
>> test2.cpp compiles cleanly.
>>
>
> How do you plan on placing a value inside that struct?
>
> Are you going to define a constructor, like this?
>
>    LayoutDirection(uint val) : b(val) {}
>
> Won't that generate the same warning?

Good point.
Let's assume then that it is done right (do not use -Wconversion)
until the compiler generates the good warnings for the bitfields. But
I'll use it from time to time to reduce the warnings in non bitfields.

Best Regards.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic