kewlnamehuh / pugixml

Automatically exported from code.google.com/p/pugixml
0 stars 0 forks source link

Replace <stdio.h> by <cstdio> #222

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm not a C++ expert but I have discover something and after investigations, it 
make sense so I just share:

In pugi xml, there is a include <stdio.h>

The problem is that this pollute the global namespace which doesn't seems to be 
"the good way to do":

http://stackoverflow.com/questions/10694255/c-cmath-vs-math-h-and-similar-c-pref
ixed-vs-h-extension-headers

I humbly suggest to use: <cstdio>

Do what you want with this. :)

Original issue reported on code.google.com by dorian.f...@gmail.com on 20 Dec 2013 at 3:33

GoogleCodeExporter commented 9 years ago
Please note that the SO answer says:
"in practice no standard library implementation that i know of followed the 
standard in this respect"
So this does not have any practical value.

pugixml actually used C++-style includes for C library files 6 years ago; as 
you can see in this submit:

http://code.google.com/p/pugixml/source/detail?r=57&path=/branches/dev/src/pugix
ml.cpp

This did not work well with Borland C++. As far as I remember, the problem was 
specific to memmove - I think Borland's library actually tried to follow the 
"don't pollute global namespace" rule but ended up missing std::memmove from 
the <cstdlib> header.

Original comment by arseny.k...@gmail.com on 20 Dec 2013 at 5:31