bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] FYI: use of bool provokes HP ia64 /bin/cc compiler bug?


From: Jim Meyering
Subject: [Bug-gnulib] FYI: use of bool provokes HP ia64 /bin/cc compiler bug?
Date: Mon, 31 May 2004 13:31:43 +0200

FYI, a recent change to tr exposed what looks like a serious bug in
HP's /bin/cc compiler.  One effect was that `tr -c x y' would fail
with this diagnostic

  tr: when not truncating set1, string2 must be non-empty

because a memset zeroed out four times as much stack space as
it was supposed to.

Here's a small program to illustrate:

    $ cat k.c
    #include <stdio.h>
    #include <stdlib.h>
    #define N 256
    int
    main ()
    {
      _Bool a[N];
      printf ("%d %d\n", sizeof a, N * sizeof (a[0]));
      exit (0);
    }

Of course, the two numbers should be the same.
But here they're not:

    $ /bin/cc k.c && ./a.out
    256 1024

More details:

    $ /bin/cc -V
    cc: HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]

config.guess reports this:

    ia64-hp-hpux11.23

This was on host spe173.testdrive.hp.com.




reply via email to

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