sdk\as\bindings\scriptbindings.cpp: In function `void Register_ProjectFile(asIScriptEngine*)':
sdk\as\bindings\scriptbindings.cpp:262: warning: invalid access to non-static data member `ProjectFile::project' of NULL object
sdk\as\bindings\scriptbindings.cpp:262: warning: (perhaps the `offsetof' macro was used incorrectly)
This goes from lines 262 to 270 of the same file.
In file included from plugins\astyle\/formattersettings.h:4,
from plugins\astyle\formattersettings.cpp:2:
plugins\astyle\/./astyle/astyle.h:68:2: warning: #warning Compiling DEBUG version (which will print lots of TRACE information to cerr)!
How to get rid of these? And I mean "fix", not just "hide" :P
I modified the codeblocks-NewBuild.cbp to include this flag, but I'd like to know if I can commit. It might throw errors using other compilers.
I thought you wanted to "fix", not just "hide"
this? :p
Rick, this flag works only for GCC-4.0 and up. Don't commit it...
According to this gcc mailing list post (http://gcc.gnu.org/ml/gcc/2003-08/msg00859.html) it would be added in 3.4. And I can confirm it's available in mingw 3.4.2:
D:\Temp> cat test.cpp
#include <cstdio>
struct data
{
data() : x(0) {}
int x;
};
int main()
{
std::printf("hello world\n");
std::printf("offsetof x: %i\n", offsetof(data, x));
}
D:\Temp> g++ test.cpp -o test.exe
test.cpp: In function `int main()':
test.cpp:12: warning: invalid access to non-static data member `data::x' of NULL object
test.cpp:12: warning: (perhaps the `offsetof' macro was used incorrectly)
D:\Temp> g++ -Wno-invalid-offsetoff test.cpp -o test.exe
D:\Temp> test
hello world
offsetof x: 0
D:\Temp> g++ --version
g++ (GCC) 3.4.2 (mingw-special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I fixed it :lol: :lol: :lol:
Actually it is pretty obvious what you have to do, read the error message :)
#undef offsetof
#define offsetof(T, M) ( reinterpret_cast <size_t> ( & reinterpret_cast <const volatile char &>(reinterpret_cast<T *> (1000)->M) ) - 1000u)
Now say again that macros are not evil 8)