View Issue Details

IDProjectCategoryView StatusLast Update
0000084LDMud 3.3LPC Compiler/Preprocessorpublic2009-03-03 15:50
Reportermenaures Assigned To 
Status closedResolutionwon't fix 
Summary0000084: Make pragma warn_missing_return default off
DescriptionI 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.
TagsNo tags attached.


related to 0000332 resolvedGnomi LDMud 3.6 Warning: Missing 'return <value>' statement. 



2008-01-25 18:13

reporter   ~0000587

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.


2008-04-01 06:59

administrator   ~0000608

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
#pragma warn_missing_return


2009-01-14 04:28

administrator   ~0000888

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.)


2009-03-03 15:50

administrator   ~0000965

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.

Issue History

Date Modified Username Field Change
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