Re: [PATCH #2/4] c++: mark short-enums as packed

2023-11-29 Thread Alexandre Oliva
On Nov 29, 2023, Jason Merrill wrote: > On 11/29/23 04:39, Alexandre Oliva wrote: >> Hello, Jason, >> On Nov 22, 2023, Jason Merrill wrote: >> >>> On 11/22/23 13:12, Jason Merrill wrote: I'm coming to the conclusion that your C++ patch is fine but we should remove the TYPE_PACKED warn

Re: [PATCH #2/4] c++: mark short-enums as packed

2023-11-29 Thread Jason Merrill
On 11/29/23 04:39, Alexandre Oliva wrote: Hello, Jason, On Nov 22, 2023, Jason Merrill wrote: On 11/22/23 13:12, Jason Merrill wrote: I'm coming to the conclusion that your C++ patch is fine but we should remove the TYPE_PACKED warning from check_address_or_pointer_of_packed_member.  And may

Re: [PATCH #2/4] c++: mark short-enums as packed

2023-11-29 Thread Alexandre Oliva
Hello, Jason, On Nov 22, 2023, Jason Merrill wrote: > On 11/22/23 13:12, Jason Merrill wrote: >> I'm coming to the conclusion that your C++ patch is fine but we >> should remove the TYPE_PACKED warning from >> check_address_or_pointer_of_packed_member.  And maybe add >> -Wcast-align=strict to -

Re: [PATCH #2/4] c++: mark short-enums as packed

2023-11-22 Thread Jason Merrill
On 11/22/23 13:12, Jason Merrill wrote: On 11/22/23 03:17, Alexandre Oliva wrote: On Nov 20, 2023, Jason Merrill wrote: I think the warning is wrong here. Interesting...  Yeah, your analysis makes perfect sense. Still, we're left with a divergence WRT the TYPE_PACKED status of enum types b

Re: [PATCH #2/4] c++: mark short-enums as packed

2023-11-22 Thread Jason Merrill
On 11/22/23 03:17, Alexandre Oliva wrote: On Nov 20, 2023, Jason Merrill wrote: I think the warning is wrong here. Interesting... Yeah, your analysis makes perfect sense. Still, we're left with a divergence WRT the TYPE_PACKED status of enum types between C and C++. It sort of kind of mak

Re: [PATCH #2/4] c++: mark short-enums as packed

2023-11-22 Thread Alexandre Oliva
On Nov 20, 2023, Jason Merrill wrote: > I think the warning is wrong here. Interesting... Yeah, your analysis makes perfect sense. Still, we're left with a divergence WRT the TYPE_PACKED status of enum types between C and C++. It sort of kind of makes sense to mark short enums as packed, beca

Re: [PATCH #2/4] c++: mark short-enums as packed

2023-11-20 Thread Jason Merrill
On 11/19/23 21:33, Alexandre Oliva wrote: Unlike C, C++ doesn't mark enums shortened by -fshort-enums as packed. This makes for undesirable warning differences between C and C++, e.g. c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early*.c triggers a warning about a type cast fro

[PATCH #2/4] c++: mark short-enums as packed

2023-11-19 Thread Alexandre Oliva
Unlike C, C++ doesn't mark enums shortened by -fshort-enums as packed. This makes for undesirable warning differences between C and C++, e.g. c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early*.c triggers a warning about a type cast from a pointer to enum that, when packed, migh