GNOME Bugzilla – Bug 765042
subparse: fix build error with GCC 4.6.3
Last modified: 2016-04-15 12:35:35 UTC
Created attachment 325990 [details] [review] subparse: fix build error with GCC 4.6.3 gstsubparse.c: In function ‘parse_subrip’: gstsubparse.c:988:7: error: ignoring return value of ‘strtol’, declared with attribute warn_unused_result [-Werror=unused-result] cc1: all warnings being treated as errors
Uh, that's ..., casting a return value to (void) has been used for centuries to indicate that the return value is not use on purpose, I wonder when that changed? (Also, what distro is this? Why doesn't anyone else get this?)
This particular one is on Ubuntu 12.04.5, gcc 4.6.3. Why others don't get this... Maybe GCC developers realized they'd gone too far in the false positive direction and reverted ? Since that's an old distro, if it's fine everywhere, I guess It'd be fine to leave it as is.
Ah well, might just as well fix it properly. Could you change the strtol() to g_ascii_strtoll/ull() while you're at it?
Created attachment 326088 [details] [review] subparse: fix build error with GCC 4.6.3
Comment on attachment 326088 [details] [review] subparse: fix build error with GCC 4.6.3 Thanks, looks good to me. Please could you git commit --amend to add the bugzilla url at the bottom. The if blocks could probably also be if else if else if ? (But doesn't really matter I suppose)
Created attachment 326090 [details] [review] subparse: fix build error with GCC 4.6.3 both done.
Comment on attachment 326090 [details] [review] subparse: fix build error with GCC 4.6.3 Thanks, please just push if/when you're happy with it :)
Thanks, pushed: commit d1ecd3cfa732fe9aeeb55850d9fe8bc4801c8099 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Fri Apr 15 12:54:32 2016 +0100 subparse: fix build with GCC 4.6.3 gstsubparse.c: In function ‘parse_subrip’: gstsubparse.c:988:7: error: ignoring return value of ‘strtol’, declared with attribute warn_unused_result [-Werror=unused-resu cc1: all warnings being treated as errors https://bugzilla.gnome.org/show_bug.cgi?id=765042