Skip to content
Snippets Groups Projects
Verified Commit fd4b2ce6 authored by Thomas E. Dickey's avatar Thomas E. Dickey
Browse files

fix clang/gcc warnings for undefined behavior, also fix a bug


XtConvertAndStore may update the XrmValue value, changing its size.
clang and gcc warn about undefined behavior in the case-statement
following the call (which uses the size), but do not explain what
the problem is.  Since this code is not intended to handle changes
of the size, simply reject that case.  That quiets the gcc warnings
and is actually all that is needed for correctness.  clang still
complains (neither knows what the call does), but can be quieted
by initializing the variable before calling the function.

The code happens to work without the fix as long as it is not
used to convert between resource types which would increase the
size.

Signed-off-by: default avatarThomas E. Dickey <dickey@invisible-island.net>
parent d33708e3
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment