lkml.org 
[lkml]   [2000]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 2.3.41 - cleanup file_operations structs
[ Sunday, January 30, 2000 ] David Wragg wrote:
> James Manning <jmm@raleigh.ibm.com> writes:
> > [ Sunday, January 30, 2000 ] Ingo Oeser wrote:
> > > This feature is not ANSI-C, so it is gcc specific.
> >
> > Yup, and since the kernel is gcc-specific anyway, we might as well
> > get some benefit from it :)
>
> In cases where standard C does not suffice, I would agree. But C99
> also has designated initializers, with a different syntax from gcc:
>
> gcc-style: struct my_struct foo = { my_member: 42 };
> C99-style: struct my_struct foo = { .my_member = 42 };
>
> So could you use a macro instead, such as:
>
> #define STRUCT_ELEM_INIT(m) m :

FWIW, I chose the gcc syntax since it was already very prevelant
in the kernel... my patch simply finishes conversion for file_ops :)

1) I'd hate adding a #define to each file or create another .h dep
2) it's a simple perl script to make this change later on if it
proves to be desirable.

As it stands, gcc 2.7.2.3 is still our baseline compiler so I'd rather
keep things compatible with that my design, not by #ifdef. While I
personally like the C99 syntax better, I think it's important to at
least get named initilizers in place first, and we can either change
or abstract out the interface later on. First thing's first :)

James
--
Miscellaneous Engineer --- IBM Netfinity Performance Development

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean