bug-bison
[Top][All Lists]
Advanced

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

Re: bison-1.30j on AIX 4.3


From: H . Merijn Brand
Subject: Re: bison-1.30j on AIX 4.3
Date: Thu, 10 Jan 2002 11:38:48 +0100

On Thu 10 Jan 2002 10:38, Akim Demaille <address@hidden> wrote:
> it is present!
> 
> I think we have found the bad guy!!!

Since I can't find a man page on strnlen from here (I'm working from home
today, cause my little boy is sick) for AIX 4.3, I can't verify what IBM
claims to be the desired behaviour, but it is indeed other than your <sane>
system. Is this maybe a big/small endian problem?

> May I ask you to compile and run the following please?
> 
> /tmp % cat strnlen.c                                             nostromo 
> 10:37
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> 
> int
> main (void)
> {
>   const char *foobar = "foobar";
>   int i;
> 
>   for (i = 0; i < 10; ++i)
>     fprintf (stderr, "strnlen (%s, %d) = %d\n",
>              foobar, i, strnlen (foobar, i));
>   return 0;
> }
> /tmp % gcc strnlen.c                                             nostromo 
> 10:37
> /tmp % ./a.out                                                   nostromo 
> 10:37
> strnlen (foobar, 0) = 0
> strnlen (foobar, 1) = 1
> strnlen (foobar, 2) = 2
> strnlen (foobar, 3) = 3
> strnlen (foobar, 4) = 4
> strnlen (foobar, 5) = 5
> strnlen (foobar, 6) = 6
> strnlen (foobar, 7) = 6
> strnlen (foobar, 8) = 6
> strnlen (foobar, 9) = 6

i2:/pro/3gl/GNU/bison-1.30j 104 > cc -O2 -o test-cc test.c
1506-507 (W) No licenses available. Contact your program supplier to add 
additional users.  Compilation will proceed shortly.
i2:/pro/3gl/GNU/bison-1.30j 105 > gcc -O4 -o test-gcc test.c
i2:/pro/3gl/GNU/bison-1.30j 106 > ./test-cc
strnlen (foobar, 0) = 0
strnlen (foobar, 1) = 3
strnlen (foobar, 2) = 2
strnlen (foobar, 3) = 1
strnlen (foobar, 4) = 0
strnlen (foobar, 5) = 6
strnlen (foobar, 6) = 6
strnlen (foobar, 7) = 6
strnlen (foobar, 8) = 6
strnlen (foobar, 9) = 6
i2:/pro/3gl/GNU/bison-1.30j 107 > ./test-gcc
strnlen (foobar, 0) = 0
strnlen (foobar, 1) = 3
strnlen (foobar, 2) = 2
strnlen (foobar, 3) = 1
strnlen (foobar, 4) = 0
strnlen (foobar, 5) = 6
strnlen (foobar, 6) = 6
strnlen (foobar, 7) = 6
strnlen (foobar, 8) = 6
strnlen (foobar, 9) = 6
i2:/pro/3gl/GNU/bison-1.30j 108 > 

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.7.2 & 630 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
     WinNT 4, Win2K pro & WinCE 2.11 often with Tk800.022 &/| DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]