Re: [PATCH 1/1] Work around gcc-4.7's strict aliasing checks

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

 



On 01/22/12 01:49, Michal Soltys wrote:
> Below is approach to the "problem" from a bit different angle - using
> alias-permitting type definitions consistently where necessary - so assuring
> compiler won't (shouldn't ?) pursue any funny ideas no matter what. I'd guess
> it's the "right" thing to do - aside from going kernel way and using
> -fno-strict-aliasing everywhere (or #pragmas).
> 
> The compilation goes cleanly at Wstrict-aliasing=1 - so most aggresive yet most
> dumb at the same time (note, not checked on 4.7, but obviously I included
> necessary equivalent changes to the Jes's patch).
> 
> Anyway - side effects of Wstrict-aliasing=1 are false positives - quite a few
> of them actually (funcion argument casts where only pointers are involved, some
> pointers which are not dereferenced "nearby" and/or in the same block) - but
> false negatives should be (almost ?) nonexistent.  As mdadm is rather critical,
> and itself compiled with Wall, Wextra and Werror - I assume to be extra careful
> - this should complement those settings well.
> 
> On a bad side of this approach - it doesn't necessary make the code prettier,
> and might make people ask "the hell is this ...".

Hi Michal,

Personally I'd rather have someone who knows about the ddf on disk
format go through the code and fix properly. We're all going through the
code trying to come up with workarounds for gcc (myself included),
rather than fixing the code.

IMHO adding more ugly typedefs is a situation of where the cure is worse
than the disease.

Cheers,
Jes
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux