develooper Front page | | Postings from August 2000

Re: 122 (v1): types and structures

Thread Previous | Thread Next
Tom Christiansen
August 24, 2000 11:00
Re: 122 (v1): types and structures
Message ID:
>Tom Christiansen wrote:

>> C type declarations are pretty universally despised.

>By whom?

>This is news to me.  I have always thought that the C type declaration
>is a concise and platform-independent way of declaring a packed
>structure, and effectively hiding implementation details (offsets into it)
>from the programmer.

>What is wrong with them, that makes them despicable?

Hiding the padding means that two compilers might not be able
to get at the same thing.

If you've ever tried to properly declare signal(3), you'll 
see the main pain I was thinking about:

    void  (*signal (int, void (*) (int))) (int);

It's not normally so bad with most structures, but try declaring
an array of functions that return pointers to functions. :-(


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About