The code is a generic example of the problem. The real code that is producing the problem is a hashing API which hashes (void *) and hence uses (void **) as an out parameter type.
Exhibit A produces a warning as follows:
[nodbug:mato]$ gcc -O2 -Wall -o aliasing-test aliasing-test.c aliasing-test.c: In function `main': aliasing-test.c:28: warning: dereferencing type-punned pointer will break strict-aliasing rules
I'm using gcc version 3.3.5 (Debian 1:3.3.5-13) but the problem persists even when tested with GCC 4.x on newer systems.
Exhibit B is my proposed "fix". Can anyone advise if the code in Exhibit A is legitimate, i.e. whether or not it's really violating the strict aliasing rules as defined by the C standard? If not, then I guess the warning is spurious and I can safely use the fix.
If the code is in fact violating the standard then feel free to enlighten me how to fix it, since it seems like a legitimate thing to do :-)
Track this back : http://jaram.tistory.com/trackback/199
error C2787: 'IContextMenu' : no GUID has been associated with this object
아래와 같은 문제로 인해서 문제가 발생 됩니다. 문제 해결 방법은 2가지가 있습니다.
1. 원론적 문제 해결 방법
------------------------------------------------------------------------------ >I am building a shell extn. project in .net ide which is >converted from vC++ 6.00. > >During buid i am getting the following error >"error C2787: 'IContextMenu' : no GUID has been associated >with this object", The same project works fine in VC++6.0. > >I have included the following files also >#include <shlguid.h> >#include <shobjidl.h> >#include <shlobj.h> > >any help will be appreciated
This is interesting. There are two <comdef.h> header files in VC.NET, one in Vc7/include and the other in Vc7/PlatformSDK/include. The former splits off the smart pointer typedefs into comdefsp.h, and it doesn't include IContextMenu. The latter does. You can try to #include the PlatformSDK header directly, change your INCLUDE path order, or supply the missing typedef yourself, e.g.
-- Doug Harrison Microsoft MVP - Visual C++ ------------------------------------------------------------------------------
2. 더 간단한 방법은...
------------------------------------------------------------------------------ The response is for people that find this thread by searching for the same error.
Just define at the top of the stdafx.h file above your includes: #define _ATL_NO_UUIDOF ------------------------------------------------------------------------------
Track this back : http://jaram.tistory.com/trackback/143
[Error Case - Wince5.0]fatal error LNK1112: module machine type 'ARM' conflicts with target machine type 'X86'
문제 :
VS2005에서 Renderer Filter Compile 시 Error 발생
I am getting this error message while compiling a SubTitle Renderer Filter code in VS2005 for Wince5.0 Platform.
fatal error LNK1112: module machine type 'ARM' conflicts with target machine type 'X86'
해결
You can either for compiler to target ARM.To do so Go to Properties->Linker->Advanced->Target Machine. Verify also that in properties->Configuration Type is good because sometimes between platform switch you can have some pbs.
If you are compiling a resource DLL do not forget to set NO ENTRY POINT in Linker->Advanced.
Track this back : http://jaram.tistory.com/trackback/81
[Error Case - Wince5.0] C4430
오늘도 Builder로 써 열심히 Build를 하고 있었다... 나 <--- 난 거의 팀내 잡부로 수 많은 Link Error를 접해보는 사람이다.
아래와 같은 C4430을 마주했다.
1>.\SubtitlePresentation.cpp(109) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Class에서 Member Function을 선언하고, 실제 구현부에서 return 값을 빼먹었을때, C4430이 여지 없이 일어난다 한번 테스트를 해보길...
MSDN Error 페이지를 살펴 보니 아래와 같은 경우 발생하게 된다.
Error Message
missing type specifier - int assumed. Note: C++ does not support default-int
This error can be generated as a result of compiler conformance work that was done for Visual C++ 2005: all declarations must now explicitly specify the type; int is no longer assumed. See Breaking Changes in the Visual C++ 2005 Compiler for more information.
Track this back : http://jaram.tistory.com/trackback/67
Compiler Error C2099
Error Message
initializer is not a constant
This error is issued only by the C compiler and occurs only for non-automatic variables. The compiler initializes non-automatic variables at the start of the program and the values they are initialized with must be constant.
// C2099.c int j; int *p; j = *p; // C2099 *p is not a constant
C2099 can also occur because the compiler is not able to perform constant folding on an expression under /fp:strict because the floating point precision environment settings (see _controlfp_s for more information) may differ from compile to run time.
When constant folding fails, the compiler invokes dynamic initialization, which is not allowed in C.
To resolve this error, compile the module as a .cpp file or simplify the expression.