aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-11-16 07:26:07 +0100
committerBjörn Gustavsson <[email protected]>2012-12-06 14:22:36 +0100
commit81d6790acf9d55a63575efd93bdba1629c101b62 (patch)
tree319b38eda076912823460c2e4302d7e9f9756e93 /lib/asn1/src/asn1ct_gen.erl
parentca3b66e3d2c734e8715c7ed078e4fa9ae10462de (diff)
downloadotp-81d6790acf9d55a63575efd93bdba1629c101b62.tar.gz
otp-81d6790acf9d55a63575efd93bdba1629c101b62.tar.bz2
otp-81d6790acf9d55a63575efd93bdba1629c101b62.zip
Suppress warnings for unused variables using a compiler option
Currently, the generated code suppresses warnings for unusued variables by assigning to the "_Val" variable, for example: _Val = Tmpval5 To be completely safe, that should have been: _ = Tmpval5 in case there happens to more than one such assignment in the same scope. However, a better way to suppress warnings is to simply use the 'nowarn_unused_vars' compiler option. That method will also work for more complicated expressions there it would be cumbersome to suppress warnings by assignment to "_".
Diffstat (limited to 'lib/asn1/src/asn1ct_gen.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index b0990e92cf..57b12ce186 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -1405,7 +1405,7 @@ gen_head(Erules,Mod,Hrl) ->
emit({"%% Purpose: encoder and decoder to the types in mod ",Mod,nl,nl}),
emit({"-module('",Mod,"').",nl}),
put(currmod,Mod),
- %emit({"-compile(export_all).",nl}),
+ emit({"-compile(nowarn_unused_vars).",nl}),
case {Hrl,lists:member(inline,get(encoding_options))} of
{0,_} -> true;
{_,true} -> true;