Section One BBS

Welcome, Guest.


Subject: code stench Date: Thu Jan 17 2013 06:47 pm
From: andrew clarke To: All

Unsurprisingly, clang 3.3 is complaining about this bit of code:

clang -O2 -pipe  -Wall -W -c msgtool.c
msgtool.c:269:12: warning: cast to 'FILE *' (aka 'struct __sFILE *') from
smaller integer type 'int' [-Wint-to-pointer-cast]
    return (FILE *) ! NULL;     /* Just say OK - but it *smells* */
           ^
1 warning generated.

!NULL is 1. Why would you typecast 1 to FILE *? Baffling.

No doubt there's a potential segfault lurking in there somewhere...

</rant>

--- GoldED+/BSD 1.1.5-b20110223-b20110223
 * Origin: Blizzard of Ozz, Melbourne, Victoria, Australia (3:633/267)

Previous Message       Next Message
Replies: code stench (Rj Clay)code stench (Rj Clay)