Current-Users archive

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

Re: lint doesn't like lib/libc/string/swab.c



Am 18.04.2010 05:17, schrieb Robert Elz:
     Date:        Sat, 17 Apr 2010 22:01:01 -0400
     From:        Matthew Mondor<mm_lists%pulsar-zone.net@localhost>
     Message-ID:<201004180201.o3I211Hi009412%ginseng.xisop@localhost>

   | I suspect that
   | the code needs a cast or a slight modification since, like using an
   | extra size_t variable for use after the function prologue...

No, just back out the size_t ->  ssize_t change - if it doesn't make sense,
don't do it - simply blindly following standards, just because they exist,
is insane - that way the standards never get corrected to be sane, as (as
is their purpose) they're just specifying what "everybody" does and agrees
to - if we disagree, we have a duty to disagree completely, not just with
some "this isn't right but it is what POSIX expects" side noise...

kre


or this patch .
diff -u -r1.14 swab.c
--- lib/libc/string/swab.c    17 Apr 2010 21:42:43 -0000    1.14
+++ lib/libc/string/swab.c    18 Apr 2010 03:42:56 -0000
@@ -51,10 +51,7 @@
     const char *fp;
     char *tp;

-    /*LINTED: unportable &*/
-    if (len & 1)
-        len--;
-    if (len <= 0)
+    if (len <= 1)
         return;

     _DIAGASSERT(from != NULL);





__________ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version 5037 
(20100418) __________

E-Mail wurde geprüft mit ESET NOD32 Antivirus.

http://www.eset.com




Home | Main Index | Thread Index | Old Index