git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/1] trace2: NULL is not allowed for va_list

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Mar 19, 2019, 18:03 UTC
Message-ID
<1899eb63-c986-6c18-d09e-9b1584f471d0@jeffhostetler.com>
In-Reply-To
<20190319171347.7677-1-tboegi@web.de>
On 3/19/2019 1:13 PM, tboegi@web.de wrote:
Show 22 quoted lines
> From: Torsten Bögershausen <tboegi@web.de>
> 
> Some compilers don't allow NULL to be passed for a va_list,
> and e.g. "gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516"
> errors out like this:
>   trace2/tr2_tgt_event.c:193:18:
>     error: invalid operands to binary &&
>     (have ‘int’ and ‘va_list {aka __va_list}’)
>      if (fmt && *fmt && ap) {
>                         ^^
> I couldn't find any hints that va_list and pointers can be mixed,
> and no hints that they can't either. Morten Welinder comments:
> 
> "C99, Section 7.15, simply says that va_list "is an object type suitable for
> holding information needed by the macros va_start, va_end, and
> va_copy". So clearly not guaranteed to be mixable with pointers...
> 
> The portable solution is to use "va_list" everywhere in the callchain.
> As a consequence, both trace2_region_enter_fl() and trace2_region_leave_fl()
> now take a variable argument list.
> 
> Signed-off-by: Torsten Bögershausen <tboegi@web.de>

Looks good. Thanks for tracking this down. Jeff

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Previous: tboegi@web.de
Message 2 of 2 in “trace2: NULL is not allowed for va_list”
  1. 1/1 trace2: NULL is not allowed for va_listtboegi@web.de, Mar 19, 2019
  2. Jeff HostetlerMar 19, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.