Source-Changes archive

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

CVS commit: src/bin/echo



Module Name:    src
Committed By:   kre
Date:           Wed Nov 10 17:35:45 UTC 2021

Modified Files:
        src/bin/echo: echo.c

Log Message:
With -Wall compiling this was giving:

        echo.c: In function 'main':
        echo.c:74:1: warning: control reaches end of non-void function

This raises 2 issues.

First, why with WARNS set to 6, which should include just about
everything, was this not causing problems with everyday builds?
Surely falling off the end of a non-void function without returning
a specific value is one of the more basic errors that should be fixed.
(Whatever the name of the function).   Is there a missing -Wxxx option?

And second, does C99 really promise:
        Remove unnecessary call to exit(0); returning from main is equivalent
        since C99.
in the sense that simply falling out of main() is exit(0)?  Or is it
simply saying that the return value of main() is the exit status (which
has been true for much longer than since c99)?


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/bin/echo/echo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index