php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #30380 getopt_long doesn't work unless HARTMUT_0 is defined
Submitted: 2004-10-10 10:53 UTC Modified: 2007-10-03 17:30 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: per at computer dot org Assigned: hholzgra (profile)
Status: Closed Package: Feature/Change Request
PHP Version: 4.3.9 OS: linux 2.4.27
Private report: No CVE-ID: None
 [2004-10-10 10:53 UTC] per at computer dot org
Description:
------------
According to the manual, getopt() supports long options. However, in a standard build I receive the following:
Warning: getopt(): No support for long options in this build in <file>
Some investigation shows that getopt_long is only used when HARTMUT_0 is defined in the source. 


Reproduce code:
---------------
$options=array("aa","bb","cc");
$opt=getopt("",$options);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-10 11:04 UTC] per at computer dot org
I tried configuring and building 4.3.8 with CFLAGS=-DHARTMUT_0 - just in case I'd missed something. The build went fine, now I'll check if the long options are also working.
 [2004-10-11 07:58 UTC] derick@php.net
Hartmut,

what was the reason why you disabled this again?

Derick
 [2004-10-11 10:59 UTC] hholzgra@php.net
the commit message says

  getopt with long options reverted to configure problems
  (may find the wrong getopt.h so needed structures are not defined 
    :(     
  )

have to dig through the archives to see what that really was about ...
 [2004-10-11 11:08 UTC] hholzgra@php.net
ok, looks like bug #20063 was the reason for this ...
 [2004-10-11 14:15 UTC] per at computer dot org
Just a quick comment - as far as I can tell using getopt() with long options works fine. Obviously I haven't exactly done exhaustive tests, but still.
 [2004-11-27 20:08 UTC] per at computer dot org
Also applies to 4.3.10RC1.
 [2007-10-03 10:20 UTC] dsp@php.net
getopt with longopts work on every platform in php 5.3
 [2007-10-03 17:30 UTC] dsp@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 14:01:32 2024 UTC