Re: test-argp and clang's ASAN

2023-12-03 Thread Jeffrey Walton
On Sun, Dec 3, 2023 at 7:58 AM Bruno Haible wrote: > > In a testdir of module 'argp', built with clang 17 and -fsanitize=address, > I see this test failure: > > $ cat test-argp-2.sh.log > --- expected2023-12-03 12:52:58.892318895 +0100 > +++ out 2023-12-03 12:52:58.904318928 +0100 > @@ -27,9 +

Re: pointer addition and arrays

2023-12-03 Thread Andreas F. Borchert
On Sun, Dec 03, 2023 at 11:03:30AM +0100, Bruno Haible wrote: > There is no guarantee, but the malloc() result has an alignment of at least 4 > on all of today's platforms. [1] It may be legitimate to have such assumptions. But it is likewise legitimate that compilers and the associated libraries

test-argp and clang's ASAN

2023-12-03 Thread Bruno Haible
In a testdir of module 'argp', built with clang 17 and -fsanitize=address, I see this test failure: $ cat test-argp-2.sh.log --- expected2023-12-03 12:52:58.892318895 +0100 +++ out 2023-12-03 12:52:58.904318928 +0100 @@ -27,9 +27,9 @@ -l, --limerick create a limerick -p, --p

test-mcel fails with ASAN

2023-12-03 Thread Bruno Haible
Hi Paul, In a testdir of the 'mcel' module, compiled with "gcc -fsanitize=address" (and CFLAGS="-O0 -fno-omit-frame-pointer -ggdb" and ASAN_OPTIONS="detect_leaks=0 abort_on_error=1"), I see this test failure: ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffc6de32ad3 at pc 0x558658

Re: pointer addition and arrays

2023-12-03 Thread Bruno Haible
Andreas F. Borchert wrote: > > foo *p = (foo *) m; /* CAST */ > ... > This line is not guaranteed to be ok due to § 6.3.2.3, (7): > >A pointer to an object type may be converted to a pointer to a different >object type. If the resulting pointer is not correctly aligned for the >r

Re: pointer addition and arrays

2023-12-03 Thread Andreas F. Borchert
> foo.c > > #include > #include > #ifdef __GNUC__ > # define unreachable() __builtin_unreachable () > #endif > typedef struct { int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t; } foo; > int main () > { > char *m = malloc (1)

Re: undefined-behavior obstack.c:139

2023-12-03 Thread Marc Nieper-Wißkirchen
Am So., 3. Dez. 2023 um 10:05 Uhr schrieb Paul Eggert : > On 2023-12-02 01:04, Bruno Haible wrote: > > On the contrary, I will try to find and eliminate such alarms. > > Please don't complicate and/or slow down shared Gnulib code just to > pacify this particular false alarm from Clang. The obstack

Re: undefined-behavior obstack.c:139

2023-12-03 Thread Paul Eggert
On 2023-12-02 01:04, Bruno Haible wrote: On the contrary, I will try to find and eliminate such alarms. Please don't complicate and/or slow down shared Gnulib code just to pacify this particular false alarm from Clang. The obstack fix was fine, because it made obstack clearer and no slower. B