public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* Why the cplusplus doesn't support -D_FORTIFY_SOURCE
@ 2020-08-24  6:53 sword_iii
  0 siblings, 0 replies; 2+ messages in thread
From: sword_iii @ 2020-08-24  6:53 UTC (permalink / raw)
  To: newlib

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Why the cplusplus doesn't support -D_FORTIFY_SOURCE
@ 2020-08-24  7:14 Yingchun Li
  0 siblings, 0 replies; 2+ messages in thread
From: Yingchun Li @ 2020-08-24  7:14 UTC (permalink / raw)
  To: newlib

Sorry, My previous post
https://sourceware.org/pipermail/newlib/2020/017909.html
shows the  wrong format, sorry for that.
Now post it again.

In the sys/features.h, the "__SSP_FORTIFY_LEVEL" will not be defined when
the source file is cplusplus.
#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
#endif
So, 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-24  7:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24  6:53 Why the cplusplus doesn't support -D_FORTIFY_SOURCE sword_iii
2020-08-24  7:14 Yingchun Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).