www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Warning re ignored return value

reply Don Allen <donaldcallen gmail.com> writes:
Is there a way to request that dmd warn about instances where the 
return values of non-void functions are ignored? dmd appears not 
to do that by default and I checked the documentation of the 
command-line options and didn't see it (hopefully I missed it; it 
would be nice to have).

/Don
Aug 04 2022
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 8/4/22 7:39 PM, Don Allen wrote:
 Is there a way to request that dmd warn about instances where the return 
 values of non-void functions are ignored? dmd appears not to do that by 
 default and I checked the documentation of the command-line options and 
 didn't see it (hopefully I missed it; it would be nice to have).
 
Not sure if it's implemented yet but there's mustuse: https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1038.md -Steve
Aug 04 2022
parent max haughton <maxhaton gmail.com> writes:
On Friday, 5 August 2022 at 00:14:33 UTC, Steven Schveighoffer 
wrote:
 On 8/4/22 7:39 PM, Don Allen wrote:
 Is there a way to request that dmd warn about instances where 
 the return values of non-void functions are ignored? dmd 
 appears not to do that by default and I checked the 
 documentation of the command-line options and didn't see it 
 (hopefully I missed it; it would be nice to have).
 
Not sure if it's implemented yet but there's mustuse: https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1038.md -Steve
It's implemented.
Aug 04 2022