This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
__builtin_constant_p() and string literals
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 18 Oct 2003 15:45:58 +0200
- Subject: __builtin_constant_p() and string literals
If __builtin_constant_p() is invoked in an inline function, it's not
possible to tell if a char* argument is the value of a string literal.
For security reasons, I want to ensure that certain functions are only
called with arguments which are string literals (and not dynamically
constructed strings). Is there a way to achieve that without using
macros?
How hard would it be to implement such functionality in GCC if it's not
there yet?