cURL / Mailing Lists / curl-library / Single Mail


Re: curl_easy_setopt and typeof

From: Nathan E. Moore <>
Date: Sun, 13 Apr 2008 11:29:58 -0400

--On Sunday, April 13, 2008 4:32 PM +0200 Michal Marek <>

> David Shaw napsal(a):
> ...
> Yes, but the docs say that you should pass a long here, not int. For the
> time being, the macro allows int, too, because insisting on long would
> cause too much warnings almost everywhere. But I think in such a corner
> case it's really the application that should be fixed.
> BTW, can you point me to the code doing this? gnupg-2.0.9 builds fine
> here...
> Michal

It is irrelevant what the docs say it is perfectly legal to pass a smaller
type to a varargs function expecting a larger one. It will just work, just
like it would for a normal function. There is no reason the type checker
should be more restrictive than c. It should allow anything that can be
promoted to long (char, short, int long, bitfields, enums).

Nathan Moore
Received on 2008-04-13