You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Martin Kraemer <Ma...@mch.sni.de> on 1997/08/19 16:14:40 UTC

[PATCH] ReliantUNIX detection in GuessOS

The SINIX and ReliantUNIX SVR4 versions of Siemens Nixdorf Information
Systems (SNI) have the same code base. In fact, when calling uname(2) on
a SINIX machine, both names appear in the resulting utsname structure.

On the 32 bit version of SINIX, "uname -s" used to print "SINIX-N" (or
SINIX-Y or some other letter). The new forthcoming 64 bit version appears
to output uname -s  => "ReliantUNIX-N" instead.

I just compiled apache-1.3a2-dev on the forthcoming 64 bit SINIX-N 5.44
(aka. ReliantUNIX-N 5.44) and noticed that GuessOS can't deal with this
version yet. I guess it's reasonable to treat these two names similarly.

Here's a patch:

--- helpers/GuessOS.bak	Tue Jul 22 01:09:31 1997
+++ helpers/GuessOS	Tue Aug 19 15:21:01 1997
@@ -183,7 +183,7 @@
 	echo "${MACHINE}-unknown-ultrix"; exit 0
 	;;
 
-    SINIX*)
+    SINIX-?:* | ReliantUNIX-?:*)
 	echo "${MACHINE}-sni-sysv4"; exit 0
 	;;
 


    Martin
__________________________________________________________________________
PS: there were a lot of warnings (there are many on the 32-bit SINIX, too,
it's the same compiler; the int-sizes are no problem, however).
None of these warnings seems to point to a dangerous area, however.
If you should be interested in the complete list (which I doubt ;-) feel
free to ask me.

The warnings could be classified as: (there were 600+ warnings total)

<<<--- Widening of ints to longs --->>>
alloc.c   193: [warning]:   CFE1859 result of small arithmetic used as wider type
      if (min_size + BLOCK_MINFREE <= blok->h.endp - blok->h.first_avail) {
          ^

alloc.c   514: [warning]:   CFE1859 result of small arithmetic used as wider type
      memcpy (new_data, dst->elts, dst->nalloc * elt_size);
                                   ^

http_core.c  1352: [warning]:   CFE1805 Conversion from integral to pointer of different size
  { "<FilesMatch", filesection, (void*)1, OR_ALL, RAW_ARGS, "Container for directives affecting files matching specified patterns" },
                                ^

<<<--- Narrowing of longs to ints --->>>
alloc.c   354: [warning]:   CFE1807 Conversion of a large integral may lose bits
    int nclicks = 1 + ((reqsize - 1) / CLICK_SZ);
                  ^

alloc.c   355: [warning]:   CFE1807 Conversion of a large integral may lose bits
    int size = nclicks * CLICK_SZ;
               ^

<<<--- Use of BSD functions for which there is no prototype --->>>
<<<--- (provide an ap_strcasecmp() function?!?!) --->>>
alloc.c   608: [warning]:   CFE1676 using out-of-scope declaration of function "strcasecmp" (declared at line 595)
        if (!strcasecmp (elts[i].key, key)) {
             ^

<<<--- (Set but) Unused variables, unreachable code --->>>
alloc.c   974: [warning]:   CFE1550 variable "rv" was set but never used
      int rv;
          ^

mod_mime_magic.c  1586: [warning]:   CFE1111 statement is unreachable
          return 1;
          ^

engine.c   541: [warning]:   CFE1111 statement is unreachable
                break;
                ^

<<<--- Clash of Macros with names used by the system --->>>
buff.h    72: [warning]:   CFE1881 macro defined differently than macro "B_ERROR" (declared at line 209 of "/usr/include/sys/buf.h")
  #define B_ERROR (48)
          ^

<<<--- Different signedness of variables --->>>
util_script.c   442: [warning]:   CFE1068 integer conversion resulted in a change of sign
      if(size == -1)
                 ^

mod_mime_magic.c  1097: [warning]:   CFE1068 integer conversion resulted in a change of sign
              return -1;
                     ^

<<<--- FYI: This compiler's default sizes (in 64-bit mode) are: --->>>
sizeof(char)=1
sizeof(short)=2
sizeof(int)=4
sizeof(long)=8
sizeof(long long)=8
sizeof(void*)=8
sizeof(float)=4
sizeof(double)=8
sizeof(long double)=8
Default "char" type is "unsigned char"
--
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: [PATCH] ReliantUNIX detection in GuessOS

Posted by Dean Gaudet <dg...@arctic.org>.

On Tue, 19 Aug 1997, Martin Kraemer wrote:

> Here's a patch:

+1

> <<<--- Widening of ints to longs --->>>
> alloc.c   193: [warning]:   CFE1859 result of small arithmetic used as wider type
>       if (min_size + BLOCK_MINFREE <= blok->h.endp - blok->h.first_avail) {
>           ^

Wow I've never seen a compiler this anal.  I'm not particularly fond of
fixing these warnings... there's probably a switch that turns of that
warning, no?

> http_core.c  1352: [warning]:   CFE1805 Conversion from integral to pointer of different size
>   { "<FilesMatch", filesection, (void*)1, OR_ALL, RAW_ARGS, "Container for directives affecting files matching specified patterns" },
>                                 ^

This should be fixed -- try (void *)(long)1.  That's how most of the
similar 64-bit fixes were done.

> 
> <<<--- Narrowing of longs to ints --->>>
> alloc.c   354: [warning]:   CFE1807 Conversion of a large integral may lose bits
>     int nclicks = 1 + ((reqsize - 1) / CLICK_SZ);
>                   ^

Now these, on the other hand, should be fixed.  The fix here is to
properly start using size_t when we're talking about the size of a memory
object. 

> <<<--- Use of BSD functions for which there is no prototype --->>>
> <<<--- (provide an ap_strcasecmp() function?!?!) --->>>
> alloc.c   608: [warning]:   CFE1676 using out-of-scope declaration of function "strcasecmp" (declared at line 595)
>         if (!strcasecmp (elts[i].key, key)) {
>              ^

Can't you just prototype them and make it quiet?

> <<<--- (Set but) Unused variables, unreachable code --->>>
> alloc.c   974: [warning]:   CFE1550 variable "rv" was set but never used
>       int rv;
>           ^

Fixed.

> mod_mime_magic.c  1586: [warning]:   CFE1111 statement is unreachable
>           return 1;
>           ^

fixed.

> engine.c   541: [warning]:   CFE1111 statement is unreachable
>                 break;
>                 ^

not fixed ... regex code.  I don't feel like touching it.

> <<<--- Clash of Macros with names used by the system --->>>
> buff.h    72: [warning]:   CFE1881 macro defined differently than macro "B_ERROR" (declared at line 209 of "/usr/include/sys/buf.h")
>   #define B_ERROR (48)
>           ^

Ugh.  I guess we need to s#B_foobar#BUFF_foobar# all of our buff defines.

> <<<--- Different signedness of variables --->>>
> util_script.c   442: [warning]:   CFE1068 integer conversion resulted in a change of sign
>       if(size == -1)
>                  ^

These too should be fixed.

Dean