Re: -Wall -Wcast-qual and SYSINIT

1999-01-28 Thread Matthew Dillon
:Anyway, GCC actually does have an extension that addresses this :problem. See "Labeled Elements in Initializers" in the info pages. :Note, this extension should NOT be used, in my opinion. : :John :-- : John Polstra j...@polstra.com : John D. Polst

Re: -Wall -Wcast-qual and SYSINIT

1999-01-28 Thread John Polstra
In article <199901280753.xaa98...@apollo.backplane.com>, Matthew Dillon wrote: > > Unfortunately, GCC isn't smart enough to match the function type > to the correct structure - it always stuffs it into the first structure. Don't blame GCC. The C standard requires it to behave the way i

Re: -Wall -Wcast-qual and SYSINIT

1999-01-28 Thread Bruce Evans
>>From my uderstanding, SYSINIT should always point to a function with a >CONST argument because the argument is fixed as a constant at link/compile >time. > >what functions don't expect a const? and why not? Probably most. >or am I mising something? Only the initial value of the arg is determin

Re: -Wall -Wcast-qual and SYSINIT

1999-01-28 Thread Matthew Dillon
:On Thu, 28 Jan 1999, Matthew Dillon wrote: : :OK I understand now.. :theoretically I guess you should have two types of SYSINIT, :however you are already not able to check the TYPE of the argument due to :it being passed through the void form, so losing the 'const'-ness is not :that much of a loss

Re: -Wall -Wcast-qual and SYSINIT

1999-01-28 Thread Matthew Dillon
: :Overloading a struct? Yuck :( : :> :> So the above cool hack will not work :-(. : :Overloading is just a bad hack in concept. Tell me something I don't know. If it were simple and straightforward, I'd have simply committed it. -Matt : Br

Re: -Wall -Wcast-qual and SYSINIT

1999-01-28 Thread Brian Feldman
On Wed, 27 Jan 1999, Matthew Dillon wrote: > Right now we have a problem with struct sysinit. > > The problem is that some SYSINIT functions supply a function taking > a const void * and a const pointer for data, and other SYSINIT > functions supply a function taking a void * and

Re: -Wall -Wcast-qual and SYSINIT

1999-01-28 Thread Julian Elischer
On Thu, 28 Jan 1999, Matthew Dillon wrote: > Most of the functions do not expect a const argument, though that > may simply be because they didn't bother to use const when they > could have. > > However, I know at least the MALLOC initialization objects *can't* > use const

Re: -Wall -Wcast-qual and SYSINIT

1999-01-28 Thread Matthew Dillon
: :>From my uderstanding, SYSINIT should always point to a function with a :CONST argument because the argument is fixed as a constant at link/compile :time. : :what functions don't expect a const? and why not? : :or am I mising something? : :julian Most of the functions do not expect a const

Re: -Wall -Wcast-qual and SYSINIT

1999-01-28 Thread Julian Elischer
>From my uderstanding, SYSINIT should always point to a function with a CONST argument because the argument is fixed as a constant at link/compile time. what functions don't expect a const? and why not? or am I mising something? julian To Unsubscribe: send mail to majord...@freebsd.org with "

-Wall -Wcast-qual and SYSINIT

1999-01-27 Thread Matthew Dillon
Right now we have a problem with struct sysinit. The problem is that some SYSINIT functions supply a function taking a const void * and a const pointer for data, and other SYSINIT functions supply a function taking a void * and a non-const pointer for data. What this means