Re: gcc warnings

"h.g. muller" <[email protected]>
Newsgroups gmane.comp.gnu.xboard.devel
Message-ID <[email protected]>
>>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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.