[erlang-questions] Can't run my command line Erlang program
Andrew Pennebaker
andrew.pennebaker@REDACTED
Fri Nov 15 05:03:07 CET 2013
Is there a way to clear the "unknown functions" from dialyzer output? They
tend to distract from any warnings I'm trying to find.
$ make lint
erlc -Wall +debug_info ios7crypt.erl
dialyzer *.beam --build_plt --quiet
dialyzer *.beam
Checking whether the PLT /Users/andrew/.dialyzer_plt is up-to-date... yes
Proceeding with analysis...
Unknown functions:
crypto:exor/2
erlang:binary_to_list/1
erlang:get_module_info/1
erlang:get_module_info/2
erlang:list_to_integer/2
erlang:now/0
getopt:parse/2
getopt:usage/2
init:get_plain_arguments/0
init:stop/0
io:format/1
io:format/2
io_lib:format/2
proper:forall/2
proper:quickcheck/1
proper_types:int/0
proper_types:list/1
random:seed/3
random:uniform/1
string:concat/2
string:substr/3
done in 0m0.17s
done (passed successfully)
On Thu, Nov 14, 2013 at 10:59 PM, Andrew Pennebaker <
andrew.pennebaker@REDACTED> wrote:
> I think I was trying to account for errors in parsing integers. In any
> case, I think my program still works fine without this check, especially as
> we agree that dialyzer proves it's unnecessary.
>
>
> https://github.com/mcandre/ios7crypt/commit/8d7f7760b15ffa48a5113356803f620f3935c256#diff-7f4a95d512e55854e52ac3744eaafeb1L52
>
>
> On Thu, Nov 14, 2013 at 8:00 PM, Kostis Sagonas <kostis@REDACTED> wrote:
>
>> On 11/15/2013 01:46 AM, Andrew Pennebaker wrote:
>>
>>> In particular, I'm confused what dialyzer doesn't like about line 60.
>>>
>>> 59 FirstOne = case is_binary(FirstTemp) of
>>> 60 true -> binary_to_list(FirstTemp);
>>> 61 false -> FirstOneRaw
>>> 62 end,
>>>
>>> Not sure what's wrong. I tried using `_` instead of `false`, but got the
>>> same warning. Should I use an if/else instead of case?
>>>
>>
>> Dialyzer is telling you that it thinks FirstTemp will never be a binary
>> in your program, so the case statement you have there is unnecessary. So,
>> effectively it tells you that you can rewrite the code above to:
>>
>> FirstOne = FirstOneRaw,
>>
>> The question is why do you expect that FirstTemp may be a binary at that
>> point?
>>
>> Kostis
>>
>
>
>
> --
> Cheers,
>
> Andrew Pennebaker
> www.yellosoft.us
>
--
Cheers,
Andrew Pennebaker
www.yellosoft.us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20131114/b9118cf8/attachment.htm>
More information about the erlang-questions
mailing list