Skip to contentSkip to conversation

TST_BRK_SUPPORTS_ONLY_TCONF_TBROK() error message

LTP Petr Vorel 2 participants 3 messages Apr 30, 2019

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

Hi Jan,

your commit 0738e3753 ("lib: build check parameters for tst_brk()") added check for invalid types. I guess we didn't find a way how to print meaningful error message e.g. "tst_brk(): invalid type, please use TBROK/TCONF/TFAIL" as Xiao suggested [1]. Because error message on tst_brk(TINFO, "foo") is a bit confusing:

../../../../include/tst_common.h:69:25: error: size of unnamed array is negative
do { ((void)sizeof(char[1 - 2 * !!(condition)])); } while (0)

(this is not related to current release effort)

Kind regards,
Petr

[1] https://patchwork.ozlabs.org/comment/2026378/

author
#1 lore raw

Hi Jan,

Quoted 5 lines

your commit 0738e3753 ("lib: build check parameters for tst_brk()") added check for invalid types. I guess we didn't find a way how to print meaningful error message e.g. "tst_brk(): invalid type, please use TBROK/TCONF/TFAIL" as Xiao suggested [1]. Because error message on tst_brk(TINFO, "foo") is a bit confusing:

At least on gcc 8.3.

Quoted 2 lines

../../../../include/tst_common.h:69:25: error: size of unnamed array is negative
do { ((void)sizeof(char[1 - 2 * !!(condition)])); } while (0)

Kind regards,
Petr

#2 lore raw
In reply to Petr Vorel

----- Original Message -----

Quoted 5 lines

Hi Jan,

your commit 0738e3753 ("lib: build check parameters for tst_brk()") added check
for invalid types. I guess we didn't find a way how to print meaningful error

Correct - at least not something that would work easily across all compilers types/versions.

Quoted 16 lines

message e.g. "tst_brk(): invalid type, please use TBROK/TCONF/TFAIL" as Xiao suggested [1]. Because error message on tst_brk(TINFO, "foo") is a bit confusing:

../../../../include/tst_common.h:69:25: error: size of unnamed array is negative
do { ((void)sizeof(char[1 - 2 * !!(condition)])); } while (0)

(this is not related to current release effort)

Kind regards,
Petr

[1] https://patchwork.ozlabs.org/comment/2026378/