Re: Potential issue with handling of va_arg()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luc,

On 31 March 2017 at 19:55, Luc Van Oostenryck
<luc.vanoostenryck@xxxxxxxxx> wrote:
> On Fri, Mar 31, 2017 at 4:06 PM, Dibyendu Majumdar
> <mobile@xxxxxxxxxxxxxxx> wrote:
>> On 31 March 2017 at 14:47, Dibyendu Majumdar <mobile@xxxxxxxxxxxxxxx> wrote:
>>> I am investigating a failure in this test:
>>>
>>> #include <stdarg.h>
>>> #include <stdlib.h>
>>> #include <stdio.h>
>>>
>>> void error_message(const char *fmt, ...) {
>>> va_list argp;
>>> va_start(argp, fmt);
>>
>> I think this might be because the macro __builtin_va_start() is being
>> defined in sparse but this doesn't match what gets defined by gcc? I
>> see this in sparse:
>>
>
> Current support for vaarg is more faked than anything else.
> There is just the minimum needed to be able to do correct parsing
> of code using it but there is nothing behind it.
>

Okay, I think a workaround for sparse-llvm is to disable generation of
the macros related to var arg processing - this will cause the
compilation to fail with undefined errors, rather than silently
generating bad code. I have done this in dmr_C where the relevant
macros are not defined when llvm backend is being used. I was
experiencing crashes with minilua due to this issue - I have reworked
minilua so that the functions that rely upon var arg processing are
moved to a separate source file which cannot be compiled with
sparse-llvm.

For my use case the var arg issue is not a pressing issue to fix, what
is more important is that bad code is never generated and the cases
not handled correctly are detected early and compilation fails.

Thanks and Regards
Dibyendu
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux