|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-06-30 15:27 UTC] jim at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Jul 02 18:00:01 2026 UTC |
Building for apache (APXS) with UCD SNMP 3.5 (thus --enable-ucd-snmp-hack). Using Sun SPARCworks cc 4.2 on Solaris 2.6. Compilation fails for functions/snmp.c with: "functions/snmp.c", line 159: syntax error before or at: { "functions/snmp.c", line 159: syntax error before or at: ) "functions/snmp.c", line 165: syntax error before or at: if "functions/snmp.c", line 165: cannot recover from previous errors Line 159 reads: if(myargc != 1 || getParameters(ht, myargc, &a1)) return(WRONG_PARAM_COUNT); Expanding things manually with the C preprocessor shows the problem: if(myargc != 1 || getParameters(ht, myargc, &a1)) return( { wrong_param_count( ) ; return ; }); cc doesn't like the block in the arguments for return. Removing the return() around WRONG_PARAM_COUNT fixes this problem but reveals another: "functions/snmp.c", line 312: void function cannot return value "functions/snmp.c", line 320: void function cannot return value "functions/snmp.c", line 328: void function cannot return value "functions/snmp.c", line 336: void function cannot return value "functions/snmp.c", line 344: void function cannot return value Each of these looks like: return _php3_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,2); where the function itself is declared to return void and _php3_snmp also returns void. Apparently cc doesn't like either invoking a void function in a context that expects a return value, or doesn't like using return with an argument in a void function. Changing each of these to: _php_snmp(INERNAL_FUNCTION_PARAM_PASSTHRU,2); return; fixes this problem.