[erlang-bugs] make docs fails in git master
Tuncer Ayaz
tuncer.ayaz@REDACTED
Wed Oct 10 20:41:19 CEST 2012
On Wed, Oct 10, 2012 at 4:45 PM, Patrik Nyblom wrote:
> On 10/05/2012 09:59 PM, Tuncer Ayaz wrote:
>>
>> On Fri, Oct 5, 2012 at 5:48 PM, Patrik Nyblom wrote:
>>>
>>> On 10/05/2012 04:40 PM, Tuncer Ayaz wrote:
>>>>
>>>> On Fri, Oct 5, 2012 at 4:16 PM, Patrik Nyblom wrote:
>>>>>
>>>>> Right, found it, a C statement with "undefined behaviour" exposed
>>>>> by gcc 4.7. There is actually a warning from gcc. Try this patch
>>>>> to master:
>>>>> ----------------------
>>>>> diff --git a/erts/emulator/beam/erl_message.c
>>>>> b/erts/emulator/beam/erl_message.c
>>>>> index e397f07..d5b7d01 100644
>>>>> --- a/erts/emulator/beam/erl_message.c
>>>>> +++ b/erts/emulator/beam/erl_message.c
>>>>> @@ -1096,7 +1096,6 @@ erts_send_message(Process* sender,
>>>>> }
>>>>> BM_SWAP_TIMER(send,system);
>>>>> #endif /* #ifndef ERTS_SMP */
>>>>> - return;
>>>>> }
>>>>> return res;
>>>>> }
>>>>> ---------------
>>>>
>>>> Thanks, that's it.
>>>
>>>
>>> Great! Thanks for the help with the huge bisect and the error
>>> report!
>>>
>>> Fix will appear in master in a couple of days (hopefully :))!
>>
>> clang-3.2-git treats this as an error
>>
>> beam/erl_message.c:1099:2: error: non-void function 'erts_send_message'
>> should return a value [-Wreturn-type]
>>
>> while for gcc 4.7.1 it's a warning
>>
>> beam/erl_message.c:1099:2: warning: 'return' with no value, in
>> function returning non-void [-Wreturn-type]
>>
>> I don't have a gcc-4.8-git build to check with, but we can treat this
>> warning as an error with gcc-4.7:
>>
>> $ CFLAGS="-Werror=return-type" ./otp_build setup -a
>> [...]
>> beam/erl_message.c:1099:2: error: 'return' with no value, in function
>> returning non-void [-Werror=return-type]
>> cc1: some warnings being treated as errors
>
> Could you do a patch to configure that enables this if using gcc?
> That would be really nice!
Sure, I'll submit a patch.
More information about the erlang-bugs
mailing list