This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/17328] New: strlen() of static const char* string not allowed by gcc at compile time
- From: "smsti at ashtray dot jz dot gts dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Sep 2004 13:55:08 -0000
- Subject: [Bug c/17328] New: strlen() of static const char* string not allowed by gcc at compile time
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
fn()
{
static const char *p = "ahoj";
static int i = strlen("ahoj"); // will pass
static int j = strlen(p); // will not pass: error: initializer element is
not constant
}
--
Summary: strlen() of static const char* string not allowed by gcc
at compile time
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: smsti at ashtray dot jz dot gts dot cz
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i486-slackware-linux
GCC target triplet: i486-slackware-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17328