Re: [xml] Last compiler warnings (Windows)



:) I got your point about differences in compilers/platforms/etc.
However, I can find a paragraph in ANSI C standard that describes
pointer->const pointer conversion (I remember I've seen it there) :)

Anyway, I have one more "API cleanup" request for the future:
I think it's a good idea to make function names standard one day
(not now, of course :) ). Because I still could not remember when
I need to put verb at the end and when not. For example, "xmlBufferFree"
but "xmlFreeNode" and so on.
May be there is a hidden logic here but I could not get it :)


Aleksey.




Igor Zlatkovic wrote:
Hi there,

I don't think that changing the function declaration  from
something(pointer p)
to
something(const pointer p)
will create any warnings for applications simply because "const" here
tells the application that 'p' will not be changed in the function.
I absolutelly sure that it can remove some warnings but not add new ones.

Sure. There is an implicit conversion from 'a' to 'const a' and it does not
issue a warning. In theory. However, consider this example:

#include <stdio.h>
void main()
{
printf(__FILE__);
}

Compile this with MSVC in some subdirectory, say C:\subdir.

C:\subdir>cl test.c
test.c
/out:test.exe
test.obj

Okay, not run the executable, and it will print the name of it's file to
stdout:

C:\subdir>test
test.c

Now, go to the parent directory and run it from there:

C:\subdir>cd ..
C:\>subdir\test

You think it will display the same as in the previous example? No. It will
run the associated program (mostly the IDE) and load test.c into it! On my
system the last command fired the notepad editor which presented itself with
the contents of test.c, an act I would never have expected in my life. One
must see it to believe.

What I want to say with all this, you can never be sure that a particular
compiler and OS implementation would follow the rules. GNOME desktop uses
libxml and runs on dozen platforms, most of which I have never dealt with. I
have no way of knowing how badly broken these can be and the last thing I
would like to do is give a GNOME developer on some obscure platform a
thousand new warnings, just for the sake of eliminating two on my platform.
Not only he would throw darts on my picture, he would probably fashion a
toilette modelled to represent my head, skull top open :-) :-)

Okay, that was enough off-topic for today, sorry for any inconvenience. :-)

Ciao
Igor



_______________________________________________
xml mailing list, project page http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml



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