php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1636 functions/snmp.c compile fails with SW cc
Submitted: 1999-06-30 14:13 UTC Modified: 1999-06-30 15:27 UTC
From: cab at tc dot umn dot edu Assigned:
Status: Closed Package: Compile Failure
PHP Version: 3.0.11 OS: Solaris 2.6
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cab at tc dot umn dot edu
New email:
PHP Version: OS:

 

 [1999-06-30 14:13 UTC] cab at tc dot umn dot edu
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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-30 15:27 UTC] jim at cvs dot php dot net
Fixed in CVS. Thanks for the report.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Jul 02 12:00:02 2026 UTC