[PATCH] improve validation of attribute arguments (PR c/78666)

2020-07-08 Thread Martin Sebor via Gcc-patches
GCC has gotten better at detecting conflicts between various attributes but it still doesn't do a perfect job of detecting similar problems due to mismatches between contradictory arguments to the same attribute. For example, __attribute ((alloc_size (1))) void* allocate (size_t, size_t); fol

Re: [PATCH] improve validation of attribute arguments (PR c/78666)

2020-08-20 Thread Aldy Hernandez via Gcc-patches
First, didn't Marek say in the PR that the diagnostic code should go in diagnose_mismatched_attributes? An overall comment-- could we write a generic validator rather than having to special case validation on a case by case basis? Is there way of marking attributes as immutable if specified o

Re: [PATCH] improve validation of attribute arguments (PR c/78666)

2020-08-20 Thread Martin Sebor via Gcc-patches
On 8/20/20 3:00 PM, Aldy Hernandez wrote: First, didn't Marek say in the PR that the diagnostic code should go in diagnose_mismatched_attributes? My understanding of the structure of the attribute handling code is that with just a few exceptions, for C and C++ it's pretty much all in c-attribs.

Re: [PATCH] improve validation of attribute arguments (PR c/78666)

2020-08-24 Thread Aldy Hernandez via Gcc-patches
On 8/21/20 1:37 AM, Martin Sebor wrote: On 8/20/20 3:00 PM, Aldy Hernandez wrote: Regardless, here are some random comments. Thanks for the careful review! diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c index 37214831538..bc4f409e346 100644 --- a/gcc/c-family/c-attribs

Re: [PATCH] improve validation of attribute arguments (PR c/78666)

2020-08-24 Thread Martin Sebor via Gcc-patches
On 8/24/20 4:59 AM, Aldy Hernandez wrote: On 8/21/20 1:37 AM, Martin Sebor wrote: On 8/20/20 3:00 PM, Aldy Hernandez wrote: Regardless, here are some random comments. Thanks for the careful review! diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c index 37214831538..bc4f4

Re: [PATCH] improve validation of attribute arguments (PR c/78666)

2020-08-24 Thread Aldy Hernandez via Gcc-patches
Attached is another revision of this patch with the new helper function you suggested.  Is this version okay to commit? I don't actually have the ability to grant check-in in this area. I just figured that implementing some of these suggestions might make it more palatable to reviewers who do

[PING][PATCH] improve validation of attribute arguments (PR c/78666)

2020-09-09 Thread Martin Sebor via Gcc-patches
Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552500.html Aldy provided a bunch of comments on this patch but I'm still looking for a formal approval. Martin On 8/24/20 10:45 AM, Martin Sebor wrote: On 8/24/20 4:59 AM, Aldy Hernandez wrote: On 8/21/20 1:37 AM, Martin Sebor wro

[PING][PATCH] improve validation of attribute arguments (PR c/78666)

2020-07-16 Thread Martin Sebor via Gcc-patches
Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549686.html (Jeff, I forgot to mention this patch when we spoke earlier today.) On 7/8/20 6:01 PM, Martin Sebor wrote: GCC has gotten better at detecting conflicts between various attributes but it still doesn't do a perfect job of detec

Re: [PING][PATCH] improve validation of attribute arguments (PR c/78666)

2020-09-15 Thread Joseph Myers
On Wed, 9 Sep 2020, Martin Sebor via Gcc-patches wrote: > Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552500.html > > Aldy provided a bunch of comments on this patch but I'm still looking > for a formal approval. This patch is OK. > > Some testing revealed that the code has diff

Re: [PING][PATCH] improve validation of attribute arguments (PR c/78666)

2020-09-16 Thread Martin Sebor via Gcc-patches
On 9/15/20 5:15 PM, Joseph Myers wrote: On Wed, 9 Sep 2020, Martin Sebor via Gcc-patches wrote: Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552500.html Aldy provided a bunch of comments on this patch but I'm still looking for a formal approval. This patch is OK. Some testin

[PING 2][PATCH] improve validation of attribute arguments (PR c/78666)

2020-07-26 Thread Martin Sebor via Gcc-patches
Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549686.html On 7/16/20 4:53 PM, Martin Sebor wrote: Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549686.html (Jeff, I forgot to mention this patch when we spoke earlier today.) On 7/8/20 6:01 PM, Martin Sebor wrote: GCC ha

[PING 3][PATCH] improve validation of attribute arguments (PR c/78666)

2020-08-10 Thread Martin Sebor via Gcc-patches
Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549686.html On 7/26/20 11:41 AM, Martin Sebor wrote: Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549686.html On 7/16/20 4:53 PM, Martin Sebor wrote: Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549686.html (J