[Bug 51356] Fix C warnings in the Telepathy tests library
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Mon Jul 30 15:15:12 CEST 2012
https://bugs.freedesktop.org/show_bug.cgi?id=51356
--- Comment #6 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-07-30 13:15:12 UTC ---
(In reply to comment #5)
> It allows gcc to warn about missing cases in the switch statement
That's not fixing a warning, that's introducing a new warning and then fixing
it :-P
Given that the default behaviour of an unhandled case in a switch is "do
nothing", and that's entirely appropriate for a change to a status you don't
recognise, I don't think the current code is wrong.
(Thought experiment: what would happen if Telepathy 1.0 added a DISCONNECTING
status, or a NEARLY_THERE status, or something? Answer: it would be reasonable
for nothing to happen when arriving at that status, the same as is currently
done for CONNECTING. So "do nothing by default" seems good.)
> it does have a fairly
> low signal-to-noise ratio.
Yes, that's my objection. I think it's more likely that sprinkling mutable
casts through the code causes a bug to go undetected than that a string
constant is unintentionally modified.
> If possible, a better fix would be to change the data structure
> to use const gchar* rather than gpointer for the affected field
This is an incompatible change (I think) but I would not necessarily object to
it for Telepathy 1.0. In this case I don't think the field is always a char
pointer (it's a user_data sort of thing) but gconstpointer would be OK.
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the telepathy-bugs
mailing list