Web lists-archives.org

Re: [Mingw-users] Using dbghelp.dll - problems with dbghelp.h




Doug Borter wrote:

> I discovered that g++ handles the code much better than gcc.
> Here's the compiler output:

That's surprising given that C++ is more strict in a number of aspects. 
I wouldn't recommend compiling C with a C++ compiler as a general
practice unless the code has been fortified to be C++ type-safe.

> dbghelp.h:1749: error: `__out_bcount_opt' has not been declared
> dbghelp.h:1749: error: expected `,' or `...' before "PVOID"
> dbghelp.h:1751: error: ISO C++ forbids declaration of `Size' with no
> type
> dbghelp.h:2832: error: `__in_bcount_opt' has not been declared
> dbghelp.h:2832: error: expected `,' or `...' before "PBYTE"
> dbghelp.h:2834: error: ISO C++ forbids declaration of `Size' with no
> type
> dbghelp.h:2844: error: `__in_bcount_opt' has not been declared
> dbghelp.h:2844: error: expected `,' or `...' before "PBYTE"
> dbghelp.h:2846: error: ISO C++ forbids declaration of `Size' with no
> type
> dbghelp.h:2856: error: `__in_bcount_opt' has not been declared
> dbghelp.h:2856: error: expected `,' or `...' before "PBYTE"
> dbghelp.h:2858: error: ISO C++ forbids declaration of `Size' with no
> type

__in_bcount_opt is another of those specstrings.h declarators.  If you
look at the top of the file, empty ones are defined for compatibility
for those without specstrings.h, and it looks like somebody just omitted
__in_bcount_opt.  You should be able to just add it.

> debug.c: In function `int getDebugInfo(char*)':
> debug.c:110: error: invalid conversion from `void*' to `unsigned int*'
> debug.c:111: error: invalid conversion from `void*' to `char*'
> debug.c:112: error: invalid conversion from `void*' to `Sym*'
> debug.c:165: error: invalid conversion from `BOOL (*)(TCHAR*, ULONG,
> ULONG, void*)' to `BOOL (*)(const CHAR*, ULONG, ULONG, void*)'
> debug.c:165: error:   initializing argument 3 of `BOOL
> SymEnumerateSymbols(void*, ULONG, BOOL (*)(const CHAR*, ULONG, ULONG,
> void*), void*)'

These all seem to be errors due to trying to compile C with a C++
compiler, since C++ has more strict rules about casting void * and about
const correctness.  Can you please show the output with gcc?

Brian

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users