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
On Sun, 21 Jan 2007 08:32:44 -0600, "Jeff Pohlmeyer" yetanothergeek@gmail.com wrote:
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.
Thank you. I guess I never got aware of that. Your patch was applied with SVN r1217.
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.key