View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000084||LDMud 3.3||LPC Compiler/Preprocessor||public||2004-07-13 08:04||2009-03-03 15:50|
|Summary||0000084: Make pragma warn_missing_return default off|
|Description||I think this pragma should be default-off; until now, it was considered a feature that uninitialized variables are 0 and functions without return values return 0. So, naturally, nobody (at least none of the old-school lpc programmers) wants to have to add these "return 0" at the end of each non-void function.|
It's nice to have such a pragma, it can be useful in certain cases, but if I use it it will be as rarely as I use for example strict_types pragma.
|Tags||No tags attached.|
I agree to that. There are even cases like a switch() statement with a 'return' in each of the branches, where the end of the function will never be reached.
To add a 'return' statement only to satisfy the driver sounds odd.
Mhmm, most of you probably know this, but if not: the immediate solution for people who don't like the current default behaviour is to use the H_AUTO_INCLUDE driver hook:
set_driver_hook(H_AUTO_INCLUDE, "#pragma no_warn_missing_return\n");
For files, you would like to have the warnings, you can then add the
Gnomi and I discussed shortly about this.
Basically we both think, that at the current state probably all users who don't like to default, have added it to their auto-include hook. So if we change now, the only result is, that all users who want to have the warning, have to add it to their auto-include hook as well...
(Of course, we both agree that 0000332 is the major problem of this pragma.)
||As nobody else writes anything, I close this one and and suggest to leave the default as it is with the argument given in Note 888. Please re-open if you disagree.|
|2004-07-13 08:04||menaures||New Issue|
|2008-01-25 18:13||Coogan||Note Added: 0000587|
|2008-04-01 06:59||zesstra||Note Added: 0000608|
|2009-01-08 05:13||zesstra||Relationship added||related to 0000332|
|2009-01-14 04:28||zesstra||Note Added: 0000888|
|2009-03-03 15:50||zesstra||Note Added: 0000965|
|2009-03-03 15:50||zesstra||Status||new => closed|
|2009-03-03 15:50||zesstra||Resolution||open => won't fix|