On Fri, Oct 6, 2017 at 2:06 PM, Bernd Edlinger
wrote:
> On 10/06/17 17:43, Martin Sebor wrote:
>> On 10/06/2017 07:25 AM, Bernd Edlinger wrote:
>>> On 10/05/17 18:16, Martin Sebor wrote:
In my (very quick) tests the warning appears to trigger on all
strictly incompatible conversions, eve
On Fri, Oct 6, 2017 at 4:37 PM, Martin Sebor wrote:
> On 10/06/2017 12:06 PM, Bernd Edlinger wrote:
>>
>> On 10/06/17 17:43, Martin Sebor wrote:
>>>
>>> On 10/06/2017 07:25 AM, Bernd Edlinger wrote:
On 10/05/17 18:16, Martin Sebor wrote:
>
> In my (very quick) tests the warning a
On 10/06/17 22:50, Jeff Law wrote:
> On 10/06/2017 09:43 AM, Martin Sebor wrote:
>> On 10/06/2017 07:25 AM, Bernd Edlinger wrote:
>>> On 10/05/17 18:16, Martin Sebor wrote:
In my (very quick) tests the warning appears to trigger on all
strictly incompatible conversions, even if they are o
On 10/06/2017 09:43 AM, Martin Sebor wrote:
> On 10/06/2017 07:25 AM, Bernd Edlinger wrote:
>> On 10/05/17 18:16, Martin Sebor wrote:
>>> In my (very quick) tests the warning appears to trigger on all
>>> strictly incompatible conversions, even if they are otherwise
>>> benign, such as:
>>>
>>>
On 10/05/2017 03:47 PM, Joseph Myers wrote:
> On Thu, 5 Oct 2017, Bernd Edlinger wrote:
>
>> Maybe it would be good to not warn in type-casts, when they can be
>> assumed to be safe, for instance
>> void* <-> any pointer (parameter or result),
>> uintptr_t <-> any int, any pointer (parameter or re
On 10/06/2017 12:06 PM, Bernd Edlinger wrote:
On 10/06/17 17:43, Martin Sebor wrote:
On 10/06/2017 07:25 AM, Bernd Edlinger wrote:
On 10/05/17 18:16, Martin Sebor wrote:
In my (very quick) tests the warning appears to trigger on all
strictly incompatible conversions, even if they are otherwise
On 10/06/17 17:43, Martin Sebor wrote:
> On 10/06/2017 07:25 AM, Bernd Edlinger wrote:
>> On 10/05/17 18:16, Martin Sebor wrote:
>>> In my (very quick) tests the warning appears to trigger on all
>>> strictly incompatible conversions, even if they are otherwise
>>> benign, such as:
>>>
>>> int f
On 10/06/2017 07:25 AM, Bernd Edlinger wrote:
On 10/05/17 18:16, Martin Sebor wrote:
In my (very quick) tests the warning appears to trigger on all
strictly incompatible conversions, even if they are otherwise
benign, such as:
int f (const int*);
typedef int F (int*);
F* pf1 = f;
On 10/05/17 18:16, Martin Sebor wrote:
> In my (very quick) tests the warning appears to trigger on all
> strictly incompatible conversions, even if they are otherwise
> benign, such as:
>
> int f (const int*);
> typedef int F (int*);
>
> F* pf1 = f; // -Wincompatible-pointer-type
On 10/05/2017 03:04 PM, Bernd Edlinger wrote:
On 10/05/17 18:16, Martin Sebor wrote:
On 10/03/2017 01:33 PM, Bernd Edlinger wrote:
I'm not sure if this warning may be a bit too strict, but I think
so far it just triggered on rather questionable code.
Thoughts?
My initial thought is that alt
On Thu, 5 Oct 2017, Bernd Edlinger wrote:
> Maybe it would be good to not warn in type-casts, when they can be
> assumed to be safe, for instance
> void* <-> any pointer (parameter or result),
> uintptr_t <-> any int, any pointer (parameter or result),
> void (*) (void) and void (*) (...) <-> any
On 10/05/17 18:16, Martin Sebor wrote:
> On 10/03/2017 01:33 PM, Bernd Edlinger wrote:
>>
>> I'm not sure if this warning may be a bit too strict, but I think
>> so far it just triggered on rather questionable code.
>>
>> Thoughts?
>
> My initial thought is that although casts between incompatible
On 10/5/17, Bernd Edlinger wrote:
> On 10/05/17 02:24, Eric Gallager wrote:
>> Sorry if this is a stupid question, but could you explain how this
>> warning is different from -Wbad-function-cast? Something about direct
>> calls to functions vs. passing them as function pointers?
>
> No, it is not
On 10/03/2017 01:33 PM, Bernd Edlinger wrote:
Hi!
I have implemented a warning -Wcast-function-type that analyzes
type casts which change the function signatures.
I would consider function pointers with different result type
invalid, also if both function types have a non-null TYPE_ARG_TYPES
I
On Thu, 5 Oct 2017, Bernd Edlinger wrote:
> But why is int(*)(int) compatible to (int)(*)() but not
> to int(*)(int,...) ?
I think it's a matter of what function types were possible in K&R C.
variadic types weren't (there was an older ), and
neither were types with arguments of type float or
On Okt 05 2017, Bernd Edlinger wrote:
> The idea for this warning came up when someone spotted a place in
> openssl, where a type cast was used to change the return value of a
> callback function from long to int:
>
> https://github.com/openssl/openssl/issues/4413
>
> But due to the type cast the
On 10/03/17 23:34, Joseph Myers wrote:
> On Tue, 3 Oct 2017, Bernd Edlinger wrote:
>
>> invalid, also if both function types have a non-null TYPE_ARG_TYPES
>> I would say this deserves a warning. As an exception I have
>
> I'm not convinced by the TYPE_ARG_TYPES check, at least for C.
>
I will
On 10/05/17 02:24, Eric Gallager wrote:
> Sorry if this is a stupid question, but could you explain how this
> warning is different from -Wbad-function-cast? Something about direct
> calls to functions vs. passing them as function pointers?
No, it is not :)
-Wbad-function-cast is IMHO a strange l
On Tue, Oct 3, 2017 at 3:33 PM, Bernd Edlinger
wrote:
> Hi!
>
> I have implemented a warning -Wcast-function-type that analyzes
> type casts which change the function signatures.
>
> I would consider function pointers with different result type
> invalid, also if both function types have a non-nul
On Tue, 3 Oct 2017, Bernd Edlinger wrote:
> invalid, also if both function types have a non-null TYPE_ARG_TYPES
> I would say this deserves a warning. As an exception I have
I'm not convinced by the TYPE_ARG_TYPES check, at least for C.
In C, unprototyped function types are not compatible with
Hi!
I have implemented a warning -Wcast-function-type that analyzes
type casts which change the function signatures.
I would consider function pointers with different result type
invalid, also if both function types have a non-null TYPE_ARG_TYPES
I would say this deserves a warning. As an except
21 matches
Mail list logo