On Mon, 2009 Jan 19 20:48:51 +0100, Enrico Tröger wrote:
On a similar note, I recently experienced some nasty crashes when using the geanyvc and spellcheck plugn together. After some investigation, I figured that in geanyvc.c there was a function 'execute_command' which was not declared static and without prototype. No problem so far. But the spellcheck plugin uses enchant and enchant loads libvoikko which loads libmalaga and libmalaga also has a function 'execute_command'. So there was a clash between these symbols for some reason causing weird segfaults when using any command of geanyvc which calls its 'execute_command'. Frank fixed this in r380 and the morale of the story is: use static whenever possible :). Probably a prototype for 'execute_command' had also fixed the problem.
At least there would have been a possibility of a conflict, which would have revealed the problem sooner. Function clashes like that are a tricky animal---that's when the binutils folks start talking about "weak" symbols and the like. The other moral of your story is, if the function isn't going to be static (and *especially* if it's exported from a shared library), then for heaven's sake, namespace the name!
-Wstrict-prototypes :-) The warning it gives you is "function declaration isn’t a prototype".
But this option is not much fun since it causes many, many warnings in GLib/GTK headers.
Oh, of course. It's a rare luxury to be able to look at warnings directly during compilation; I usually postprocess the build log to filter out the ones I don't want to see.
Surely you're not going to let other people's laziness compromise *your* exacting standards, hmmm? ;-)
--Daniel