httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject overloaded functions
Date Thu, 24 Jun 1999 21:56:14 GMT
Oh, one thing ages back which I said was nifty in C++:

    char *strchr(char *, int);
    const char *strchr(const char *, int);

That way you don't have to lose the "const" when you use this on a const
string... this helps detect bugs at compile time.

But gnu c gives me what I want:

#ifef __GNUC__
#define my_strchr(a,b)  ((typeof (a)) strchr((a), (b)))
#else
#define my_strchr strchr
#endif

... which is good enough for most of the developers to get the warnings :)

Dean


Mime
View raw message