GNU bug report logs -
#8697
possibly-uninitialized variables in find_automatic_composition
Previous Next
Reported by: handa <handa <at> m17n.org>
Date: Thu, 19 May 2011 01:34:02 UTC
Severity: minor
Merged with 8290
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Very sorry for the late response on this matter.
In article <4D841112.50403 <at> cs.ucla.edu>, Paul Eggert <eggert <at> cs.ucla.edu> writes:
> In the Emacs trunk, src/composite.c's find_automatic_composition has
> two local variables 'check' and 'prev' that gcc -Wuninitialized warns
> as being possibly being uninitialized when used. This function has
> multiple gotos and dependencies on data structures that I don't
> understand, so it's not clear to me that GCC is wrong here. So I'm
> filing a bug report in the hopes that someone more expert can look at it.
> I plan to work around the diagnostic by committing the following
> change, which adds a FIXME comment asking for initial value if needed,
> and for the comment to be removed if the code is OK as-is. IF_LINT
> is used to tell GCC not to issue a warning here, for now.
> I'm CC:ing this to Kenichi Handa, who committed the code in question,
> to give him a heads-up about the problem.
Actually, those local variables are surely initialized when
used. But as they are initialized under a specific
condition (e.g. check_val is set to non-nil) and used under
the same condition, it's difficult for gcc to detect that.
Anyway, I've just committed an inproved version of
find_automatic_composition, and gcc won't complain about it
now.
2011-05-18 Kenichi Handa <handa <at> m17n.org>
* composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
(BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
(find_automatic_composition): Mostly rewrite for efficiency.
---
Kenichi Handa
handa <at> m17n.org
This bug report was last modified 14 years and 10 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.