Re: [xml] Last compiler warnings (Windows)
- From: Igor Zlatkovic <igor stud fh-frankfurt de>
- To: <aleksey aleksey com>
- Cc: <xml gnome org>
- Subject: Re: [xml] Last compiler warnings (Windows)
- Date: Tue, 16 Apr 2002 22:18:30 +0200
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]