octave-maintainers
[Top][All Lists]
Advanced

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

Re: [OctDev] complex error function


From: Steven G. Johnson
Subject: Re: [OctDev] complex error function
Date: Wed, 21 Nov 2012 21:42:58 -0500
User-agent: Thunderbird 2.0.0.24 (Macintosh/20100228)

Daniel J Sebald wrote:
Who is "you"? The library standard can't tell some C programmer outside of the standard library developers he or she can't use a function called "cerfc". When the standard uses the word "reserved", the implied subject is the library itself. (I carefully worded what I wrote last time.)

From section 7.1.3 of the C99 standard:
Each identifier with file scope listed in any of the following subclauses (including the future library directions) is reserved for use as a macro name and as an identifier with file scope in the same name space if any of its associated headers is included.
        ...
If the program declares or defines an identifier in a context in which it is reserved (other than as allowed by 7.1.4), or defines a reserved identifier as a macro name, the behavior is undefined.

i.e. "you" is any C programmer that includes complex.h, if you don't want undefined behavior to result. And the standard absolutely CAN tell any C programmer that she can't use a function called "cerfc" (without risking undefined behavior).

As for the standard, it says those names can be put into the complex.h header file. I don't know if the authors meant the functions can be implemented, or the names can be put in there to reserve them and then just issue some kind of warning if some programmer actually tries to use them.

They are just there for warnings. According to the C99 standard, section 7.1.3, a system header file may "optionally declares or defines identifiers listed in its associated future library directions subclause".

It is not realistic to expext glibc to merge an implementation of these functions prior to standardization.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]