opensubscriber
   Find in this group all groups
 
Unknown more information…

x : xboard-devel@gnu.org 16 April 2012 • 9:17PM -0400

Re: [XBoard-devel] gcc warnings
by h.g. muller

REPLY TO AUTHOR
 
REPLY TO GROUP





>>I just removed the 9 warnings of type unused-but-set-variable and the 2
>>warnings of type unused-function that would be enabled by Arun's proposal
>>in the master branch. I totally cannot see how these removals make the
>>code more unreadable.

Perhaps that is because they have nothing to do with the 'no-parentheses'
warnings?

>PS. It may be a good idea to check if the removals of unused variables and
>functions are correct. Maybe some the variables or functions should have
>been used for correct behavior of the program. If that was the case, the
>warnings were indeed useful to discover the error.

Sure, I will check whatever was changed, to see if removal was the proper
fix, or if the warning was caused by a deeper problem.

The really nasty problem, however, is not so much the warning of implicit
function declarations, but of functions that have prototypes in separate .c
files, rather than in a common .h file. And similarly, variables that are
declared external in a .c file, without occurring in a .h file. I tried to
fix that wherever I encountered it during the refactoring of master. (But
that did not progress any further than the X11 front-end yet.)

It is also highly recommendable that all variables shared between front-end
and back-end allocate space in the back-end. So that new front-ends that
don't need them do not run into undefined reference errors. It would be
still better if such variables were not needed at all, and all info was
passed as function arguments.




Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.