xboard-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XBoard-devel] gcc warnings


From: h.g. muller
Subject: Re: [XBoard-devel] gcc warnings
Date: Mon, 16 Apr 2012 14:17:11 +0100


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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]