xlC vs nginx
Using xlc_r, make fails at:
...
xlc_r -c -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/local/include -I objs -o objs/src/os/unix/ngx_errno.o src/os/unix/ngx_errno.c
"src/os/unix/ngx_errno.c", line 36.43: 1506-046 (S) Syntax error.
"src/os/unix/ngx_errno.c", line 36.29: 1506-068 (W) Operation between types "unsigned long" and "struct {...}*" is not allowed.
"src/os/unix/ngx_errno.c", line 36.9: 1506-068 (W) Operation between types "struct {...}*" and "unsigned long" is not allowed.
"src/os/unix/ngx_errno.c", line 38.12: 1506-275 (S) Unexpected text ')' encountered.
"src/os/unix/ngx_errno.c", line 57.26: 1506-018 (S) Operand of indirection operator must be a pointer expression.
"src/os/unix/ngx_errno.c", line 64.37: 1506-275 (S) Unexpected text ';' encountered.
"src/os/unix/ngx_errno.c", line 64.44: 1506-277 (S) Syntax error: possible missing ';' or ','?
make: 1254-004 The error code from the last command is 1.
Stop.
make: 1254-004 The error code from the last command is 2.
Stop.
The referring lines in ngx_errno.c:
---
+33 {
+34 ngx_str_t *msg;
+35
+36 msg = ((ngx_uint_t) err < NGX_SYS_NERR) ? &ngx_sys_errlist[err]:
+37 &ngx_unknown_error;
+38 size = ngx_min(size, msg->len);
+39
+40 return ngx_cpymem(errstr, msg->data, size);
+41 }
+42
+43
+44 ngx_uint_t
+45 ngx_strerror_init(void)
+46 {
+47 char *msg;
+48 u_char *p;
+49 size_t len;
+50 ngx_err_t err;
+51
+52 /*
+53 * ngx_strerror() is not ready to work at this stage, therefore,
+54 * malloc() is used and possible errors are logged using strerror().
+55 */
+56
+57 len = NGX_SYS_NERR * sizeof(ngx_str_t);
+58
+59 ngx_sys_errlist = malloc(len);
+60 if (ngx_sys_errlist == NULL) {
+61 goto failed;
+62 }
+63
+64 for (err = 0; err < NGX_SYS_NERR; err++) {
+65 msg = strerror(err);
+66 len = ngx_strlen(msg);
+67
+68 p = malloc(len);
+69 if (p == NULL) {
+70 goto failed;
+71 }
+72
+73 ngx_memcpy(p, msg, len);
+74 ngx_sys_errlist[err].len = len;
+75 ngx_sys_errlist[err].data = p;
+76 }