[Geany-devel] [patch] "Constify" some arguments and fields
lists.ban at xxxxx
Wed Apr 21 20:51:33 UTC 2010
I'm used to compile my programs with quite strict compiler options ,
and it made me see that the plugin API had some non-const arguments or
field where it probably should have const ones - where string literals
are most likely expected.
I think of keybindings_set_item(), plugin_signal_connect(), the
PluginInfo structure, etc. I think it is quite important since it makes
the plugin API cleaner (IMHO) and allows to write more clean plugins (no
more useless implicit promotions that may even be invalid).
Attached a patch with the suggested changes.
Although this changes some API code, I think it is completely API and
ABI  compatible: changes only makes the API more permissive on given
On quite the same topic, would a patch that fixes a lot of small
problems like that in Geany's core be appreciated? It isn't hard to do
but I think it would clean the code a bit.
 -Wall -W -O2 -Wunused -Wunreachable-code -Wformat=2 -Wundef -Wshadow
-Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wconversion
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute
-Wredundant-decls -Wnested-externs -pedantic
 even though I don't know so much about ABI things, I doubt the const
information would ever be part of it - at least on x86.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4361 bytes
Desc: not available
More information about the Devel