Red Hat Bugzilla – Bug 114368
2 * missing return statement
Last modified: 2007-11-30 17:10:35 EST
Description of problem:
I just tried to compile package gtk-engines-0.12-1 from Redhat
Fedora Core 1.
The compiler said
hicontrast_theme_draw.c(441): remark #1011: missing return statement
at end of non-void function "draw_thin_shadow"
The source code is
I'm not sure what the fix is for this. Maybe change the return type
of the function to void, or add a return statement at the end of the
hicontrast_theme_draw.c(507): remark #1011: missing return statement
at end of non-void function "draw_spin_entry_shadow"
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Both functions are missing "static void". It is not a problem. I
suggest to close this bug as not a bug.
>Both functions are missing "static void".
>It is not a problem.
If you can prove that there is no way to get to the end of
the function, then yes.
There is a serious problem if the return value from either
of these functions gets used.
>I suggest to close this bug as not a bug.
It seems we agree on the fix.
grep -rC 5 draw_thin_shadow *|less
grep -rC 5 draw_spin_entry_shadow *|less
I've checked again. It seems quite obvious to me that there is no
problem. Other opinions?
This is definitely a bug, the implicit return type of a
C function (an old deprecated feature of C) is int, not void.
TThe missing 'void' doesn't cause any problems but for the
compiler (a random int will be returned and ignored) but the
missing static is more of a problem, since it means that
the names are leaked into the global symbol namespace.