Re: problem in modular programing
On 2006-02-22, Jordan Abel <random832@gmai l.com> wrote:[color=blue]
> On 2006-02-22, Richard G. Riley <rgrileyevomer@ gmail.com> wrote:[color=green]
>> Interesting. It was never a problem I came across but it makes some
>> sense. But I'm a little confused about what you mean by my *header*
>> needing things. I normally try to keep module headers as simple
>> declarations of that modules capabilities - the c module itself
>> includes the headers that it needs. If you follow me :)[/color]
>
> The header may need to include other headers that declare types which
> are used for parameters or return values within the header (as with FILE
> in the example)[/color]
True, if this is the case. Special types I tend to keep in type
headers though. If, as in your example one needs to do that then I
have always tried to only include in those modules which need.
I'm interested in this other statement that the compiler needs it to check
the prototype against the declaration : while I can see that this
might be useful I've not (habitually) done it since I tend to export
the headers from the module anyway and also the linker raises any
issues. Is this bad practice? if it is, I'll put it right but it never
caused me a problem. Any light you can throw on this is appreciated.
--
Remove evomer to reply
On 2006-02-22, Jordan Abel <random832@gmai l.com> wrote:[color=blue]
> On 2006-02-22, Richard G. Riley <rgrileyevomer@ gmail.com> wrote:[color=green]
>> Interesting. It was never a problem I came across but it makes some
>> sense. But I'm a little confused about what you mean by my *header*
>> needing things. I normally try to keep module headers as simple
>> declarations of that modules capabilities - the c module itself
>> includes the headers that it needs. If you follow me :)[/color]
>
> The header may need to include other headers that declare types which
> are used for parameters or return values within the header (as with FILE
> in the example)[/color]
True, if this is the case. Special types I tend to keep in type
headers though. If, as in your example one needs to do that then I
have always tried to only include in those modules which need.
I'm interested in this other statement that the compiler needs it to check
the prototype against the declaration : while I can see that this
might be useful I've not (habitually) done it since I tend to export
the headers from the module anyway and also the linker raises any
issues. Is this bad practice? if it is, I'll put it right but it never
caused me a problem. Any light you can throw on this is appreciated.
--
Remove evomer to reply
Comment