GNOME Bugzilla – Bug 99516
glib-genmarshal script does not put the #include directive in the c source file
Last modified: 2004-12-22 21:47:04 UTC
When I created the header and c files for user marshallers using glib-genmarshal, I had to add the following line to the c file : #include "name_of_the_source.h" else I had warnings saying that they were undeclared functions.
How would you fix it? glib-genmarshal doesn't know the name of the target file. You just have to echo '#include "foo-marshal.h"' > foo-marshal.c glib-genmarshal [stuff] >> foo-marshal.c if you are using -Wmissing-prototypes
Yes you're right so I guess I have to hack a bit more my Makefile (I want that to be automatic, so that we do not have to replunge in this whenever we need a new marshaller. Sorry for this "bug", and thanks for the tips.
Owen, maybe the .c file could also include the declarations for the functions it defines? It's certainly not a big deal, but it prevents people from building with -Werror, and that's a bit annoying.
Well, it certainly doesn't people from building with -Werror -Wmissing-protos, see above for one solution. I suppose we could emit duplicated prototypes into the C file, though it's essentially silly: just a trick to fool -Wmissing-protos. (The whole point of requiring prototypes is to prevent mismatches) If you want to attach a patch and reopen the bug...
Created attachment 18552 [details] [review] Patch