This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: log2 as function not as macro

> -----Original Message-----
> From: cygwin-owner On Behalf Of Corinna Vinschen
> Sent: 14 June 2004 14:48

> On Jun 14 14:11, Johnny Willemsen wrote:
> > Hi,
> > 
> > Are there plans to deliver log2 as regular function instead 
> of macro. The
> > log2 as macro is hard to use in projects that also define a 
> log2 function. I
> > know, we can work around it, but it comes back and back again.
> You could ask this on the newlib list, newlib@

  And the answer there will probably be that if your code depends on whether
this function is a macro or a real function then your code is not valid C.
The C language spec specifically says that implementations are free to
provide library functions as macros as well as functions.  See

and in particular the lines that say "The following shall be declared as
functions and may also be defined as macros. Function prototypes shall be

  So if your code has a problem with that, your code does not comply with
the C language spec.

Can't think of a witty .sigline today....

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]