using std::FILE

Richard B. Kreckel kreckel at ginac.de
Tue Dec 18 22:48:25 CET 2007


Hi!

Marc Glisse wrote:
> On Mon, 17 Dec 2007, Richard B. Kreckel wrote:
>> This is rejected by all versions of g++ I have access to, from gcc 3.3
>> to gcc 3.4 prereleases.
> 
> Try again with sun studio compilers on solaris.

Whoops, you must be kidding recommending a non-free compiler to an 
open-source developer.

>> Can you, please, point out the relevant section in the standard and, if
>> necessary, file a bug report for GCC?
> 
> I already pointed the relevant section of the standard on this list last 
> week...
> paragraph D.5.2

Okay, thank you. You are correct according to the C++98 standard. That 
is not much help for people who are using any GCC with GMP, though.

> "Every C header, each of which has a name of the form name.h, behaves as 
> if each name placed in the Standard library namespace by the 
> corresponding cname header is also placed within the namespace scope of 
> the namespace std and is followed by an explicit using-declaration 
> (7.3.3)."
> 
> The related gcc bugs are easy to find (standard function declarations 
> linking into global namespace 6257, __cplusplus still not defined as 
> 199711L 1773, etc) and are currently blocked. There is a defect report 
> for the c++ standard that asks to make the current gcc behavior legal, 
> claiming that doing otherwise requires cooperation from libc which is 
> too hard (although solaris does it quite properly):
> http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#456
> apparently they have decided to make what gcc does legal in the future 
> revision of the standard and specify:
> stdio.h declares FILE, cstdio declares std::FILE, and each one is 
> allowed but not required to also declare it in the other namespace.
> 
> This list is not the best place to discuss this though.

Again: You must be kidding. I am an open-source developer having a 
problem with my open-source program's configure script breaking with an 
open-source library's header (<gmp.h>) on *the* open-source compiler. 
Plus, it appears like the compiler is not going to be fixed but the 
standard is going to be changed. This leaves two places where it can be 
fixed: my library and <gmp.h>. Yes, I will do it for my library, all 
right. And if the next developer walks up and observes that <gmp.h> and 
<stdio.h> do not commute (as any sane header files should), you can help 
her by saying this is not our problem although it would be trivial to 
fix. Wow! You know what? Real code is full of silly workarounds for 
silly problems.

Get a life, please.
    -richy.
-- 
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>


More information about the gmp-bugs mailing list