This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version = NetBeans IDE 7.1 (Build 201112071828) Operating System = Linux version 3.2.0-0.bpo.2-amd64 running on amd64 Java; VM; Vendor = 1.7.0-internal Runtime = OpenJDK 64-Bit Server VM 23.0-b21 As stated the C99 standard makes the following function _completely_ valid yet netbeans believes that it's not. Thus I am lead to believe that netbeans doesn't even support the c99 standard, thus it should be added to the list of things as I can imagine quite a few people require some of the new features in c99. The function is below, I'm using the P99 header macros to do the variable argument bits, but it is completely valid, it compiles with gcc, and it works exactly how it says. #define substring(...) P99_CALL_DEFARG(substring, 3, __VA_ARGS__) #define substring_defarg_2() (-1) char *substring(char *string, size_t start, size_t len) { size_t length = strlen(string); if(len == SIZE_MAX){ len = length - start; } char *to_string = malloc(len + 1); memcpy(to_string, string+start, len); to_string[len] = '\0'; return to_string; }
QE: now it should be covered by c99 testbase