Re: Casting the return value of ...

Liste des GroupesRevenir à l c 
Sujet : Re: Casting the return value of ...
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c
Date : 09. Apr 2024, 10:03:40
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uv2sos$3o6o$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 09/04/2024 08:01, Tim Rentsch wrote:
scott@slp53.sl.home (Scott Lurndal) writes:
 
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
scott@slp53.sl.home (Scott Lurndal) writes:

We compile with -Wall -Werror and have never seen any warnings related
to casting the result of dlsym(), and we build with GCC[4..13].
>
Do you use -pedantic?  Compiling with -pedantic using gcc 8.4.0
gives a warning diagnostic (and a fatal error if -pedantic-errors
is specified in place of -pedantic).
>
Of course not.  We write production code not standard C (or in this
case, C++) code.    Portability to compilers other than gcc is
not a requirement for the several million line codebase.
 It's quite amusing to hear of a team that insists on -Wall but
avoids -pedantic, saving a tiny drizzle of cases (all of which
are easy to remedy) while enduring the ever-changing force 5
blizzard of conditions tested by -Wall.
I guess that's because his team writes real-world code using real-world tools, rather than living in some sort of fantasy realm or ivory tower.
gcc's -Wall does not change much from version to version, and not without a lot of debate and consideration.  A new warning does not get added to -Wall unless there is strong confidence and agreement that it will have a very low rate of false positives, and the things it catches have a high rate of being real problems (not just stylistic choices). And part of the beta test procedure involves complete rebuilds of the entire Debian and Red Hat source bases - many packages would fail to build if changes to -Wall triggered new warnings.
And most real-world C programs are not strictly limited to fully portable standard C.  If portability is not an issue, then compiler extensions give you a better language - better error checking, more efficient results, easier coding, clearer coding, and of course features that are tied to the target platform.  "-pedantic" is not helpful for such code.
Of course there are also people whose C coding must be strictly according to the standards, and there are endless other variants in how people use the language, tools and flags.  But I expect the use of "-Wall" without "-Wpedantic" to be very much more common than the opposite.

Date Sujet#  Auteur
28 Mar 24 * Casting the return value of ...31Kenny McCormack
28 Mar 24 +* Re: Casting the return value of ...27Kaz Kylheku
28 Mar 24 i+* Re: Casting the return value of ...20Keith Thompson
28 Mar 24 ii`* Re: Casting the return value of ...19bart
28 Mar 24 ii +* Re: Casting the return value of ...12Keith Thompson
28 Mar 24 ii i+- Re: Casting the return value of ...1Chris M. Thomasson
28 Mar 24 ii i+* Re: Casting the return value of ...8Kaz Kylheku
29 Mar 24 ii ii+* Re: Casting the return value of ...5Kaz Kylheku
29 Mar 24 ii iii`* Re: Casting the return value of ...4Kaz Kylheku
29 Mar 24 ii iii `* Re: Casting the return value of ...3Michael S
29 Mar 24 ii iii  `* gcc Bugzilla search (was: Casting the return value of ...)2Michael S
29 Mar 24 ii iii   `- Re: gcc Bugzilla search1David Brown
29 Mar 24 ii ii+- Re: Casting the return value of ...1Keith Thompson
8 Jun 24 ii ii`- Re: Casting the return value of ...1Tim Rentsch
29 Mar 24 ii i`* Re: Casting the return value of ...2David Brown
30 Mar 24 ii i `- Re: Casting the return value of ...1Chris M. Thomasson
29 Mar 24 ii `* Re: Casting the return value of ...6David Brown
29 Mar 24 ii  `* Re: Casting the return value of ...5bart
29 Mar 24 ii   +- Re: Casting the return value of ...1David Brown
30 Mar 24 ii   `* Re: Casting the return value of ...3Tim Rentsch
30 Mar 24 ii    `* Re: Casting the return value of ...2bart
9 Apr 24 ii     `- Re: Casting the return value of ...1Tim Rentsch
30 Mar 24 i`* Re: Casting the return value of ...6Tim Rentsch
31 Mar 24 i +* Re: Casting the return value of ...3Lawrence D'Oliveiro
31 Mar 24 i i+- Re: Casting the return value of ...1David Brown
31 Mar 24 i i`- Re: Casting the return value of ...1Chris M. Thomasson
9 Apr 24 i `* Re: Casting the return value of ...2Tim Rentsch
9 Apr 24 i  `- Re: Casting the return value of ...1David Brown
29 Mar 24 +* Re: Casting the return value of ...2Andrey Tarasevich
29 Mar 24 i`- Re: Casting the return value of ...1Keith Thompson
30 Mar 24 `- Re: Casting the return value of ...1Tim Rentsch

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal