Re: [PATCH v2] Print padding size when aligning struct member

2023-03-28 Thread Vit Kabele
le like this? - padding struct with %d bytes to align %q+D + padding struct to align %q+D with %d bytes to be consistent with: padding struct size to alignment boundary with %E bytes -- Best regards, Vit Kabele

Re: [PATCH] Print padding size when aligning struct member

2023-02-07 Thread Vit Kabele
/* { dg-warning "padding struct with 7 bytes to align" "" { > > target { ! default_packed } } } */ > > The actual amount of padding is target dependent. Ah sorry, would removing everything after `with...` be ok? Like this: > + long baz; /* { dg-warning "padding struct with" "" { target { ! > default_packed } } } */ -- Best regards, Vit Kabele

[PATCH v3] c: Extend the -Wpadded message with actual padding size

2022-06-27 Thread Vit Kabele
Hello, after further discussion I changed the ! default_packed to attribute aligned, so that the test passes also on targets where 4 bytes types are aligned on 2 byte boundaries. Best regards, Vit Kabele -- >8 -- Subject: [PATCH v3] c: Extend the -Wpadded message with actual padding size W

[PATCH v2] c: Extend the -Wpadded message with actual padding size

2022-06-22 Thread Vit Kabele
Hello, I added the ! default_packed directive, and now the test is properly skipped on the targets with that property. I tested with cris-elf target and the test behaves properly. Best regards, Vit Kabele -- >8 -- Subject: [PATCH v2] c: Extend the -Wpadded message with actual padding size W

Re: [PATCH] c: Extend the -Wpadded message with actual padding size

2022-06-22 Thread Vit Kabele
fpack-struct=8" } */ > /* { dg-additional-options "-mno-ms-bitfields" { target *-*-mingw* } } */ I added the ! default_packed directive, but I am not sure whether the -fpack-struct is needed. Could you please provide a name of the particular target with such alignment constraints so I can test it? -- Thank you, Vit Kabele

Re: [PATCH] c: Extend the -Wpadded message with actual padding size

2022-06-20 Thread Vit Kabele
or similar tools, or manually determining the padding size. Tested on x86_64-pc-linux-gnu. gcc/ChangeLog: * stor-layout.cc (finalize_record_size): Extend warning message. gcc/testsuite/ChangeLog: * c-c++-common/Wpadded.c: New test. Signed-off-by: Vit Kabele --- gcc/stor-layout

[PATCH] c: Extend the -Wpadded message with actual padding size

2022-06-16 Thread Vit Kabele
-linux-gnu. gcc/ChangeLog: * stor-layout.cc (finalize_record_size): Improve warning message Signed-off-by: Vit Kabele --- gcc/stor-layout.cc | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/stor-layout.cc b/gcc/stor-layout.cc index 765f22f68b9..57ddb001780