[Geany] Patch to handle format warnings in gcc output

Jeff Pohlmeyer yetanothergeek at xxxxx
Sun Jan 21 14:32:44 UTC 2007


When I compile this code from the command line:

   printf("%d", "hello world");

I get the obvious warning:
warning: format '%d' expects type 'int', but argument 2 has type 'char *'


But when I compile the same code from inside geany, I see this:
 warning: format '-1074321152' expects type 'int', but argument 2 has
type 'char *'


The problem is that the msgwin_compiler_add() function expects a
format string, and when it sees the '%d' it looks in the va_list
for an argument that isn't there.


This patch changes the msgwin_compiler_add() to take a single
string as its argument, and adds a wrapper function named
msgwin_compiler_add_fmt() that uses the va_list.


 - Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msgwin_compiler_add_fmt.diff
Type: text/x-patch
Size: 2919 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20070121/6ae500aa/attachment.bin>


More information about the Users mailing list