This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix maybe-used-uninitialised warning.


On Sat, Jan 09, 2010 at 11:31:03AM +0000, Dave Korn wrote:
>
>    Hi,
>
>  Here are two small fixes shown up by more sensitive warnings in gcc-4.5.0.
>In hookapi.cc, it notices that the loop might not run even once; in
>fhandler_tty, it appears to miss that the loops can never exit.  That probably
>needs fixing upstream (but it may be some odd artifact of C++ language rules,
>since it only happens there, not in plain C; something to do with exceptional
>exits, maybe), but until then it seemed harmless to add a trivial return zero;
>it'll only add a handful of bytes to the dll.  (I tested attribute noreturn
>and it didn't help.)
>
>winsup/cygwin/ChangeLog:
>
>	* hookapi.cc (hook_or_detect_cygwin): Initialise i earlier to avoid
>	warning.
>
>  OK?

I'd prefer i be initialized to zero.

>winsup/cygwin/ChangeLog:
>
>	* fhandler_tty.cc (process_input): Add redundant final return to
>	silence (bogus?) warning.

These are ok.  As usual, I hate that we have to make these pointless
accommodations.  But I've been hating that for many years so it's
nothing newo.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]