Re: kerne-2.4.0-test13pre3 with gcc-2.97

4 messages, 3 authors, 2000-12-24 · open the first message on its own page

Re: kerne-2.4.0-test13pre3 with gcc-2.97

From: Alexandre Oliva <hidden>
Date: 2000-12-24 03:29:32

On Dec 23, 2000, Kaoru Fukui [off-list ref] wrote:
-		unsigned char b[0];
+		unsigned char *b;
This change (and apparently all other changes you've made) are
definitely wrong.  Zero-sized arrays as the last element of a
structure used to be an extension in GCC 2.95.2, that has been adopted
by C99 with a slightly different syntax, that GCC CVS supports: just
remove the `0' from between the braces.

With your change, you're changing what is supposed to be a structure
whose last element is a flexible array with a structure that ends with
a pointer to such an array, which means the array should be allocated
separately, and any access to it must de-reference an additional
pointer.  You'd have to adjust all uses of such a pointer to make this
change.  Could this be the reason why your modified kernel doesn't
work?

--
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: kerne-2.4.0-test13pre3 with gcc-2.97

From: Kaoru Fukui <hidden>
Date: 2000-12-24 13:53:03

From: Alexandre Oliva <redacted>
To: Kaoru Fukui <redacted>
Subject: Re: kerne-2.4.0-test13pre3 with gcc-2.97
Date: 24 Dec 2000 01:29:32 -0200
Cc: <redacted>, <redacted>
On Dec 23, 2000, Kaoru Fukui [off-list ref] wrote:
quoted
-		unsigned char b[0];
+		unsigned char *b;
This change (and apparently all other changes you've made) are
definitely wrong.  Zero-sized arrays as the last element of a
structure used to be an extension in GCC 2.95.2, that has been adopted
by C99 with a slightly different syntax, that GCC CVS supports: just
remove the `0' from between the braces.

With your change, you're changing what is supposed to be a structure
whose last element is a flexible array with a structure that ends with
a pointer to such an array, which means the array should be allocated
separately, and any access to it must de-reference an additional
pointer.  You'd have to adjust all uses of such a pointer to make this
change.  Could this be the reason why your modified kernel doesn't
work?
Thanks Alex your explain.

I tried this

 -		unsigned char b[0];
 +		unsigned char b[];

It gave me Inetrnal  error: Segmentaion fault .

I had success compileing for the kernel with my patch.

I don't understand how do I do untill.

Thanks
Kaoru


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: kerne-2.4.0-test13pre3 with gcc-2.97

From: Thomas Sailer <hidden>
Date: 2000-12-24 15:19:23

Alexandre Oliva wrote:
On Dec 23, 2000, Kaoru Fukui [off-list ref] wrote:
quoted
-             unsigned char b[0];
+             unsigned char *b;
This change (and apparently all other changes you've made) are
definitely wrong.  Zero-sized arrays as the last element of a
structure used to be an extension in GCC 2.95.2, that has been adopted
by C99 with a slightly different syntax, that GCC CVS supports: just
remove the `0' from between the braces.
Which is not backward compatible, unfortunately. So the
backward compatible fix would be "unsigned char b[1];".

Tom

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: kerne-2.4.0-test13pre3 with gcc-2.97

From: Thomas Sailer <hidden>
Date: 2000-12-24 15:20:54

Kaoru Fukui wrote:
I tried this

 -              unsigned char b[0];
 +              unsigned char b[];

It gave me Inetrnal  error: Segmentaion fault .
Not good.
I had success compileing for the kernel with my patch.
You had success _compiling_ the code, but not _running_ it.
Use b[1] instead.

Tom

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help