Why the cplusplus doesn't support -D_FORTIFY_SOURCE

sword_iii@sina.com sword_iii@sina.com
Mon Aug 24 06:53:44 GMT 2020


In the sys/features.h, the "__SSP_FORTIFY_LEVEL" will not be defined when thesource file is cpluspluse.#if _FORTIFY_SOURCE > 0 && !defined(__cplusplus) && !defined(__lint__) && \   (__OPTIMIZE__ > 0 || defined(__clang__)) && __GNUC_PREREQ__(4, 1)#  if _FORTIFY_SOURCE > 1#    define __SSP_FORTIFY_LEVEL 2#  else#    define __SSP_FORTIFY_LEVEL 1#  endif#else#  define __SSP_FORTIFY_LEVEL 0#endifSo, if defined cplusplus, the __SPP_FORTIFY_LEVEL is always 0.My question is why disable this feature,  if enable this feature forcely, is there any possible issue?Br,Yingchun


More information about the Newlib mailing list