This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/17328] New: strlen() of static const char* string not allowed by gcc at compile time


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]