Re: Question about genassym, locore.s and 0-sized arrays(showstopper for an icc compiled kernel)

2003-09-06 Thread Marcel Moolenaar
On Sat, Sep 06, 2003 at 10:57:52AM +0200, Alexander Leidinger wrote: > > ---snip--- > % #include > > struct foo { > int tag; > char obj[]; > }; > > int main(void) { > struct foo bar; > > printf("%d\n", sizeof(struct foo)); > printf("%d\n", sizeof(bar));

Re: Question about genassym, locore.s and 0-sized arrays(showstopper for an icc compiled kernel)

2003-09-06 Thread Alexander Leidinger
On Sat, 6 Sep 2003 01:42:59 -0700 John-Mark Gurney <[EMAIL PROTECTED]> wrote: > Alexander Leidinger wrote this message on Sat, Sep 06, 2003 at 10:33 +0200: > > struct { > ^ try moving foo to here. > > int tag; > > char obj[]; > > } foo; > ^^^ from here. > Uhm... yes,

Re: Question about genassym, locore.s and 0-sized arrays(showstopper for an icc compiled kernel)

2003-09-06 Thread John-Mark Gurney
Alexander Leidinger wrote this message on Sat, Sep 06, 2003 at 10:33 +0200: > struct { ^ try moving foo to here. > int tag; > char obj[]; > } foo; ^^^ from here. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has be

Re: Question about genassym, locore.s and 0-sized arrays(showstopper for an icc compiled kernel)

2003-09-06 Thread Alexander Leidinger
On Fri, 5 Sep 2003 09:55:57 -0700 Marcel Moolenaar <[EMAIL PROTECTED]> wrote: > Interesting, What does icc do with: > > struct { > int tag; > char obj[]; > } foo; > > And what does the sizeof() operator give. ---snip--- % struct { int tag; char obj[]; } foo; int m

Re: Question about genassym, locore.s and 0-sized arrays(showstopper for an icc compiled kernel)

2003-09-05 Thread Marcel Moolenaar
On Fri, Sep 05, 2003 at 10:55:07AM +0200, Alexander Leidinger wrote: > > > > It does, according to my reading of it. They may have an issue with > > dead code removal or element aliasing. The way to find out would be > > to see what they emit for "[]"... 0 lenth, or 1? > > % char array[]; > >

Re: Question about genassym, locore.s and 0-sized arrays(showstopper for an icc compiled kernel)

2003-09-05 Thread Marius Strobl
On Fri, Sep 05, 2003 at 07:34:39PM +1000, Bruce Evans wrote: > On Fri, 5 Sep 2003, I wrote: > > > ... > > If some values are unrepresentable then they need to be represtended > > using other values. E.g., add 1 to avoid 0, or multiply by the alignment > > size if some element of the tool chanin i

Re: Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel)

2003-09-05 Thread Stefan Farfeleder
On Thu, Sep 04, 2003 at 11:28:58AM -0500, Dan Nelson wrote: > In the last episode (Sep 04), Alexander Leidinger said: > > - If we depend on it: how hard would it be to rewrite it to not depend > >on 0-sized arrays (and does someone volunteer to rewrite it)? It > >would be nice if someone

Re: Question about genassym, locore.s and 0-sized arrays(showstopper for an icc compiled kernel)

2003-09-05 Thread Alexander Leidinger
On Fri, 05 Sep 2003 01:38:29 -0700 Terry Lambert <[EMAIL PROTECTED]> wrote: > Dan Nelson wrote: > > I guess the correct question to be asking is "does the ELF format allow > > 0-length symbols?" > > It does, according to my reading of it. They may have an issue with > dead code removal or elemen

Re: Question about genassym, locore.s and 0-sized arrays(showstopper for an icc compiled kernel)

2003-09-05 Thread Bruce Evans
On Thu, 4 Sep 2003, Marcel Moolenaar wrote: > On Fri, Sep 05, 2003 at 02:59:22AM +0200, Marius Strobl wrote: > > > > > > We use the size of the symbol (ie the size of the object identified > > > by the symbol) to pass around values. This we do by creating arrays. > > > If we want to export a C con

Re: Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel)

2003-09-05 Thread Alexander Leidinger
On Thu, 4 Sep 2003 15:57:31 -0700 Marcel Moolenaar <[EMAIL PROTECTED]> wrote: > On Thu, Sep 04, 2003 at 05:51:23PM -0500, Dan Nelson wrote: > > > > I guess the correct question to be asking is "does the ELF format allow > > 0-length symbols?" > > Of course. What size do you think a label should

Re: Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel)

2003-09-04 Thread Garrett Wollman
< said: > In theory, yes. In practice, maybe not. If I remember correctly, > the problem we're trying to solve is twofold: Actually, the problem we were trying to solve is simpler than that. genassym needs to be able to compute the values of certain constants from header files which are only acc

Re: Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel)

2003-09-04 Thread Marcel Moolenaar
On Fri, Sep 05, 2003 at 02:59:22AM +0200, Marius Strobl wrote: > > > > We use the size of the symbol (ie the size of the object identified > > by the symbol) to pass around values. This we do by creating arrays. > > If we want to export a C constant 'FOOBAR' to assembly and the constant > > is def

Re: Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel)

2003-09-04 Thread Marius Strobl
On Thu, Sep 04, 2003 at 03:47:09PM -0700, Marcel Moolenaar wrote: > > We use the size of the symbol (ie the size of the object identified > by the symbol) to pass around values. This we do by creating arrays. > If we want to export a C constant 'FOOBAR' to assembly and the constant > is defined to

Re: Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel)

2003-09-04 Thread Marcel Moolenaar
On Thu, Sep 04, 2003 at 05:51:23PM -0500, Dan Nelson wrote: > > I guess the correct question to be asking is "does the ELF format allow > 0-length symbols?" Of course. What size do you think a label should have otherwise? -- Marcel Moolenaar USPA: A-39004 [EMAIL PROTECTED] ___

Re: Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel)

2003-09-04 Thread Dan Nelson
In the last episode (Sep 05), Alexander Leidinger said: > On Thu, 4 Sep 2003 11:28:58 -0500 > Dan Nelson <[EMAIL PROTECTED]> wrote: > > If you're talking FreeBSD 5, you should be able to simply subsitute > > a C99 "flexible array member" (basically replace "[0]" with "[]") > > and get the same effe

Re: Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel)

2003-09-04 Thread Marcel Moolenaar
On Fri, Sep 05, 2003 at 12:14:11AM +0200, Alexander Leidinger wrote: > On Thu, 4 Sep 2003 11:28:58 -0500 > Dan Nelson <[EMAIL PROTECTED]> wrote: > > > If you're talking FreeBSD 5, you should be able to simply subsitute a > > C99 "flexible array member" (basically replace "[0]" with "[]") and get >

Re: Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel)

2003-09-04 Thread Alexander Leidinger
On Thu, 4 Sep 2003 11:28:58 -0500 Dan Nelson <[EMAIL PROTECTED]> wrote: > If you're talking FreeBSD 5, you should be able to simply subsitute a > C99 "flexible array member" (basically replace "[0]" with "[]") and get > the same effect. 0-length arrays are a gcc extension: > > http://gcc.gnu.org

Re: Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel)

2003-09-04 Thread Dan Nelson
In the last episode (Sep 04), Alexander Leidinger said: > At the moment I discussing an issue with Intel regarding 0-sized > arrays. gcc seems to be violating the standard and produces code with > an array size of "0", whereas icc produces code where an 0-sized > array has the size "1". This result

Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel)

2003-09-04 Thread Alexander Leidinger
Hi, I'm in the process of building our kernel with Intels C Compiler (icc). So far we are able to build a working UP and SMP kernel (not completely automated). Most of it works just fine (NFS-client is known to not work). At the moment I discussing an issue with Intel regarding 0-sized arrays. gc