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.
Function inside a function (in C) breaks parser. A lot of red underlines with "unexpected token" message appears. Fortunately, parser recovers after "}" that closes outer function. Code example is: #include <stdio.h> #include <stdlib.h> #define assert_true(condition) _assert_true(condition, #condition) typedef struct { int size; int capacity; void** data; } array; void* array_get(array *a, int index); void array_qsort(array *a, int (*comparator)(const void *element1, const void *element2)); int main(int argc, char** argv) { array a; int string_comparator (const void *element1, const void *element2) { const char *str1 = *((char**)element1); const char *str2 = *((char**)element2); int res = strcmp(str1, str2); return res; } array_qsort(&a, string_comparator); assert_true(strcmp(array_get(&a, 0), "1") == 0); assert_true(strcmp(array_get(&a, 1), "2") == 0); assert_true(strcmp(array_get(&a, 2), "3") == 0); assert_true(strcmp(array_get(&a, 3), "4") == 0); return (EXIT_SUCCESS); }
Fixed in http://hg.netbeans.org/cnd-main/rev/909bfffff63b
Bug 147758 should be checked too.
*** Bug 147758 has been marked as a duplicate of this bug. ***