[PATCH] Fix maybe-used-uninitialised warning.

Dave Korn dave.korn.cygwin@googlemail.com
Sat Jan 9 11:14:00 GMT 2010


  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.)


	* hookapi.cc (hook_or_detect_cygwin): Initialise i earlier to avoid



	* fhandler_tty.cc (process_input): Add redundant final return to
	silence (bogus?) warning.

  OK, or wait to see what upstream says about it?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hookapi-uninit-fix.diff
Type: text/x-c
Size: 661 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20100109/594721fe/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ttyhandler-missing-retvals-fix.diff
Type: text/x-c
Size: 714 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20100109/594721fe/attachment-0001.bin>

More information about the Cygwin-patches mailing list