Req #72450 [NEW]: INIT_CLASS_ENTRY macro should not use sizeof

From: Date: Sun, 19 Jun 2016 20:23:32 +0000
Subject: Req #72450 [NEW]: INIT_CLASS_ENTRY macro should not use sizeof
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201736@lists.php.net to get a copy of this message
From: slidertom at gmail dot com Operating system: Windows PHP version: 7.0.7 Package: Unknown/Other Function Bug Type: Feature/Change Request Bug description:INIT_CLASS_ENTRY macro should not use sizeof Description: ------------ INIT_CLASS_ENTRY macro should not use sizeof e.g. such usage is valid: INIT_CLASS_ENTRY(ce, "MyCustomClass", NULL); as compiler uses such directives: INIT_OVERLOADED_CLASS_ENTRY (class_container, class_name, functions, NULL, NULL, NULL) INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, sizeof(class_name)-1, functions, handle_fcall, handle_propget, handle_propset, NULL, NULL) but if INIT_CLASS_ENTRY is used in the function like: void InitClass(const char *class_name) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, class_name, NULL); will fail due the: INIT_OVERLOADED_CLASS_ENTRY_EX define implementation: sizeof(class_name)-1 maybe strlen (run-time) should be used to allow INIT_CLASS_ENTRY macro more general usage. -- Edit bug report at https://bugs.php.net/bug.php?id=72450&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72450&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72450&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72450&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=72450&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=72450&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=72450&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=72450&r=needscript Try newer version: https://bugs.php.net/fix.php?id=72450&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=72450&r=support Expected behavior: https://bugs.php.net/fix.php?id=72450&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=72450&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=72450&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=72450&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72450&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=72450&r=dst IIS Stability: https://bugs.php.net/fix.php?id=72450&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=72450&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=72450&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=72450&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=72450&r=mysqlcfg

« previous php.bugs (#201736) next »