lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] Important clang warning


From: address@hidden
Subject: Re: [lwip-devel] Important clang warning
Date: Thu, 24 May 2018 22:22:19 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 24.05.2018 22:16, Gisle Vanem wrote:
A pretty important warning from clang-cl:

src/contrib/ports/win32/sys_arch.c(457,28):  warning: cast between incompatible 
calling conventions
'cdecl' and 'stdcall'; calls through this pointer may abort at runtime 
[-Wcast-calling-convention]
      h = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)sys_thread_function, new_thread, 
0, &(new_thread->id));
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/contrib/ports/win32/sys_arch.c(425,1):  note: consider defining 
'sys_thread_function'
with the 'stdcall' calling convention sys_thread_function(void* arg)

Mixing stdcall with cdecl can be dangerous; maybe not in this case though?


Thanks for reporting. I'd fix this, but I don't think it's too important for:

a) this is a test port only and it never crashed for me with different compiler version and windows versions, both 32 & 64 bit

b) Since we only take one argument (void*) and never return, the two calling conventions bight be equal?


Cheers,

Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]