You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a spin off from #1866 as I believe it requires a bit of discussion.
Compiling with VS2019, I get those three warnings:
File
Line
Code
Message
data_tag.c
234
C4090
'function': different 'const' qualifiers
r_api.c
923
C4090
'function': different 'const' qualifiers
rtl_433.c
1431
C4090
'function': different 'const' qualifiers
They all come from a line that calls the free method to free memory allocated earlier. But the argument given to free is always a char const ** when the method expects a non const pointer.
Could it be that the const keyword is wrongly placed in the variable/return type declaration? I must admit that I'm always a bit confused by the possible positions of the const keyword and their respective meanings.
Any suggestion is most welcome
The text was updated successfully, but these errors were encountered:
I follow the handy rule to read types right-to-left, so a pointer to a pointer to const-chars. These instances are arrays of char const *. The contents must never be touched or free'd but the array itself is short-lived heap memory.
This is a spin off from #1866 as I believe it requires a bit of discussion.
Compiling with VS2019, I get those three warnings:
They all come from a line that calls the
free
method to free memory allocated earlier. But the argument given tofree
is always achar const **
when the method expects a nonconst
pointer.Could it be that the
const
keyword is wrongly placed in the variable/return type declaration? I must admit that I'm always a bit confused by the possible positions of theconst
keyword and their respective meanings.Any suggestion is most welcome
The text was updated successfully, but these errors were encountered: