Re: C startup code: make crtbegin code safe for clang

2016-08-07 Thread Mark Kettenis
> Date: Sun, 7 Aug 2016 20:43:23 +0200 > From: Stefan Kempf > > Philip Guenther wrote: > > On Mon, Aug 1, 2016 at 11:45 AM, Mark Kettenis > > wrote: > > >> From: j...@wxcvbn.org (Jeremie Courreges-Anglas) > > >> Date: Mon, 01 Aug 2016 20:30:33 +0200 > > >> > > >> Stefan Kempf writes: > > >> >

Re: C startup code: make crtbegin code safe for clang

2016-08-07 Thread Stefan Kempf
Philip Guenther wrote: > On Mon, Aug 1, 2016 at 11:45 AM, Mark Kettenis > wrote: > >> From: j...@wxcvbn.org (Jeremie Courreges-Anglas) > >> Date: Mon, 01 Aug 2016 20:30:33 +0200 > >> > >> Stefan Kempf writes: > >> > >> > The constructor and destructor tables are declared as arrays with one > >>

Re: C startup code: make crtbegin code safe for clang

2016-08-04 Thread Joerg Sonnenberger
On Mon, Aug 01, 2016 at 07:28:34PM +0200, Stefan Kempf wrote: > The constructor and destructor tables are declared as arrays with one > non-NULL element. Walking those until a NULL element is reached looks > like out-of-bound accesses to newer compilers, and they turn the code > into infinite loops

Re: C startup code: make crtbegin code safe for clang

2016-08-03 Thread Stefan Kempf
Philip Guenther wrote: > On Mon, Aug 1, 2016 at 11:45 AM, Mark Kettenis > wrote: > >> From: j...@wxcvbn.org (Jeremie Courreges-Anglas) > >> Date: Mon, 01 Aug 2016 20:30:33 +0200 > >> > >> Stefan Kempf writes: > >> > >> > The constructor and destructor tables are declared as arrays with one > >>

Re: C startup code: make crtbegin code safe for clang

2016-08-01 Thread Philip Guenther
On Mon, Aug 1, 2016 at 11:45 AM, Mark Kettenis wrote: >> From: j...@wxcvbn.org (Jeremie Courreges-Anglas) >> Date: Mon, 01 Aug 2016 20:30:33 +0200 >> >> Stefan Kempf writes: >> >> > The constructor and destructor tables are declared as arrays with one >> > non-NULL element. Walking those until a

Re: C startup code: make crtbegin code safe for clang

2016-08-01 Thread Mark Kettenis
> From: j...@wxcvbn.org (Jeremie Courreges-Anglas) > Date: Mon, 01 Aug 2016 20:30:33 +0200 > > Stefan Kempf writes: > > > The constructor and destructor tables are declared as arrays with one > > non-NULL element. Walking those until a NULL element is reached looks > > like out-of-bound accesses

Re: C startup code: make crtbegin code safe for clang

2016-08-01 Thread Jeremie Courreges-Anglas
Stefan Kempf writes: > The constructor and destructor tables are declared as arrays with one > non-NULL element. Walking those until a NULL element is reached looks > like out-of-bound accesses to newer compilers, and they turn the code > into infinite loops (e.g. clang 3.8), because it is undefi

C startup code: make crtbegin code safe for clang

2016-08-01 Thread Stefan Kempf
The constructor and destructor tables are declared as arrays with one non-NULL element. Walking those until a NULL element is reached looks like out-of-bound accesses to newer compilers, and they turn the code into infinite loops (e.g. clang 3.8), because it is undefined behavior. Use constructor/