euphoria

changeset 6459:5e907c0b8a39 4.0

* corrected documentation in regards to the no_value warning, modified test to find no_value warning, and corrected message texts to reflect what no_value really means. Ticket 973
author Shawn David Pringle B.Sc. <shawn.pringle@gmail.com>
date Sun Apr 15 08:54:59 2018 -0300 (10 days ago)
parents 8ba44cdf895c
children 1fd582ebf8e9
files docs/refman_2.txt source/msgtext.e tests/t_warning_options.d/dependency.e tests/t_warning_options.d/make_warnings.ex tests/t_warning_options.e
line diff
     1.1 --- a/docs/refman_2.txt	Sat Apr 14 19:23:29 2018 -0300
     1.2 +++ b/docs/refman_2.txt	Sun Apr 15 08:54:59 2018 -0300
     1.3 @@ -3932,7 +3932,7 @@
     1.4                           built-in and another global which does not override it.
     1.5                           Euphoria chooses the built-in.
     1.6  | ##not_used## |  A variable has not been used and is going out of scope.
     1.7 -| ##no_value## | A variable never got assigned a value and is going out of scope.
     1.8 +| ##no_value## | A variable is used but *never* gets assigned a value.
     1.9  | ##custom## |  Any warning that was defined using the warning() procedure.
    1.10  | ##not_reached## | After a keyword that branches unconditionally, the only
    1.11                      thing that should appear is an end of block keyword, or
     2.1 --- a/source/msgtext.e	Sat Apr 14 19:23:29 2018 -0300
     2.2 +++ b/source/msgtext.e	Sun Apr 15 08:54:59 2018 -0300
     2.3 @@ -241,8 +241,8 @@
     2.4  	{223, "[1]:[2] - built-in routine [3]() overridden again"},
     2.5  	{224, "can't mix profile and profile_time"},
     2.6  	{225, "[1]:[2] - Unknown warning name [3]"},
     2.7 -	{226, "[1] - module variable '[2]' is never assigned a value"},
     2.8 -	{227, "[1] - private variable '[2]' of [3] is never assigned a value"},
     2.9 +	{226, "[1] - module variable '[2]' is read from but never assigned a value"},
    2.10 +	{227, "[1] - private variable '[2]' of [3] is read from but never assigned a value"},
    2.11  	{228, "[1] - module constant '[2]' is not used"},
    2.12  	{229, "[1] - module variable '[2]' is not used"},
    2.13  	{230, "[1] - parameter '[2]' of [3]() is not used"},
     3.1 --- a/tests/t_warning_options.d/dependency.e	Sat Apr 14 19:23:29 2018 -0300
     3.2 +++ b/tests/t_warning_options.d/dependency.e	Sun Apr 15 08:54:59 2018 -0300
     3.3 @@ -1,4 +1,6 @@
     3.4 -foo = 2
     3.5 +integer local_boo, local_2_boo
     3.6 +public integer p_boo
     3.7 +foo = local_boo
     3.8  global function floor(integer x)
     3.9      return x
    3.10  end function
     4.1 --- a/tests/t_warning_options.d/make_warnings.ex	Sat Apr 14 19:23:29 2018 -0300
     4.2 +++ b/tests/t_warning_options.d/make_warnings.ex	Sun Apr 15 08:54:59 2018 -0300
     4.3 @@ -19,12 +19,12 @@
     4.4      -- do nothing
     4.5  end if
     4.6  
     4.7 --- do warn here that puts is being overridden {override}
     4.8 -override procedure printf(integer fd, sequence fmt, sequence s)
     4.9 -    --eu:printf(fd, fmt, s)
    4.10 -end procedure
    4.11 +-- do warn here that time is being overridden {override}
    4.12 +override function time()
    4.13 +    return 0
    4.14 +end function
    4.15  
    4.16 -printf(1, "", {})
    4.17 +time()
    4.18  
    4.19  -- warn about builtin_chosen
    4.20  puts(1, "")
    4.21 @@ -39,9 +39,13 @@
    4.22  
    4.23  
    4.24  -- warn about no_value
    4.25 -procedure baz()
    4.26 -    integer no_value
    4.27 -end procedure
    4.28 +function baz()
    4.29 +    integer no_value, no_value_2
    4.30 +    
    4.31 +    -- bad
    4.32 +    integer a_value = no_value
    4.33 +    return a_value
    4.34 +end function
    4.35  
    4.36  baz()
    4.37  
    4.38 @@ -75,3 +79,5 @@
    4.39  
    4.40  -- Code {not_reached}
    4.41  a1 = 1
    4.42 +
    4.43 +print(1, p_boo)
    4.44 \ No newline at end of file
     5.1 --- a/tests/t_warning_options.e	Sat Apr 14 19:23:29 2018 -0300
     5.2 +++ b/tests/t_warning_options.e	Sun Apr 15 08:54:59 2018 -0300
     5.3 @@ -73,7 +73,7 @@
     5.4              sequence config = configs[j]
     5.5              sequence cwf = config[P_WARNINGS]
     5.6  
     5.7 -	    sequence cmd = eui & ' ' & config[P_PARAM] & " -batch -wf " & warnings_issued & " t_warning_options.d" & SLASH & "make_warnings.ex > " & nul
     5.8 +	    sequence cmd = eui & ' ' & config[P_PARAM] & " -test -batch -wf " & warnings_issued & " t_warning_options.d" & SLASH & "make_warnings.ex > " & nul
     5.9          delete_file(warnings_issued)
    5.10  	    system(cmd,2)
    5.11  	    sequence wf = {}

SCM Home | OpenEuphoria.org Home