This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gprof -d (debug): minor getopt string bug


Hi Hans-Peter,

: The getopt string in gprof/gprof.c is slightly wrong: the '-d'
: option takes an argument, but there is no ':' following it,
: in the getopt parameter string.

Actually the arg is optional, so it ought to be followed by a double
colon.  Looking at the sources themselves it appears that what
happened is that the 'd' and 'D' options were switched in the call to
getopt_long, since the 'D' switch takes no arguments at all.

I am going to check in the patch below to fix this.

Cheers
	Nick


2000-05-26  Nick Clifton  <nickc@cygnus.com>

	* gprof.c (main): When calling getopt_long indicate that the 'd'
	switch takes an optional argument, whereas the 'D' switch takes no
	argument at all.

Index: gprof/gprof.c
===================================================================
RCS file: /cvs/src//src/gprof/gprof.c,v
retrieving revision 1.4
diff -p -r1.4 gprof.c
*** gprof.c	2000/04/05 20:53:15	1.4
--- gprof.c	2000/05/26 21:07:51
*************** DEFUN (main, (argc, argv), int argc AND 
*** 179,185 ****
    xmalloc_set_program_name (whoami);
  
    while ((ch = getopt_long (argc, argv,
! 	"aA::bBcCdD::e:E:f:F:hiI:J::k:lLm:n::N::O:p::P::q::Q::st:Tvw:xyzZ::",
  			    long_options, 0))
  	 != EOF)
      {
--- 179,185 ----
    xmalloc_set_program_name (whoami);
  
    while ((ch = getopt_long (argc, argv,
! 	"aA::bBcCd::De:E:f:F:hiI:J::k:lLm:n::N::O:p::P::q::Q::st:Tvw:xyzZ::",
  			    long_options, 0))
  	 != EOF)
      {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]