[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apropos linking `dselect'



IMO, a good C/C++ development system will include prototypes, for all
standard functions, usable from K&R C, ANSI C _and_ C++ (as applicable,
of course).

IMO, currently, a highly portable program will have the option of
declaring its own prototypes for standard functions, but will not expect
to have to.  I often do this with "#if defined(DUMB_PROTO)", tho
sometimes something finer grained is highly desireable.

IMO, programs that have prototypes for standard functions within them,
will one day be an abberation, old code used to kludge around old
development systems - the most notable example being all those systems
with ancient header files and a fairly modern compiler - like SunOS
4.1.x combined with gcc.

Note that many trivial/annoying porting issues come up, when one OS
doesn't have a prototype for a function, so a programmer adds one to an
app, and then another OS -does- have one, but it conflicts with the one
hard coded into the app.

roman@songdog.eskimo.com wrote:
> 
> > In message <m0tzdsn-00063cC@mongo.pixar.com>, Bruce Perens writes:
> > >Is it the responsibility of C headers to say "I am not C++", or is it
> > >the responsibility of C++ programs to properly declare that they
> > >are importing headers from the C universe?
> >
> > I'm not sure how the _responsibility_ could rest on anything other
> > than the C++ program, but it's common politeness for the C headers to
> > take care of it.
> 
> I think you'll be hard-pressed to find an ANSI-standard C compiler that
> accepts extern "C" { ... }.  This syntax was added to C++ so that it could
> interface with older languages that don't decorate their identifiers with
> type information.
> 
> --
> Bill Roman  (roman@songdog.eskimo.com / roman@songdog.uucp)   running linux



Reply to: