Suspicious pointer-to-pointer conversion (area too small) in C -


uint8_t *buf; uint16_t *ptr = (uint16_t *)buf; 

i feel above code correct "suspicious pointer-to-pointer conversion (area small)" lint warning. knows how solve warning?

imho, don't cast pointer @ all. changes way (representation) variable (and corresponding memory) accessed, problematic.

if have to, cast value instead.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -