bugmake - Bugs: bug #58075, getopt.c: compiler warning: add...

 
 

bug #58075: getopt.c: compiler warning: add explicit braces to avoid dangling else

Submitter:  None
Submitted:  Sun 29 Mar 2020 01:35:17 PM UTC
   
 
Severity:  3 - Normal Item Group:  Build/Install
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.3 Operating System:  POSIX-Based
Fixed Release:  4.4.1 Triage Status:  Small Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 09 Jan 2023 12:01:58 AM UTC, comment #1: 

This has been fixed.

Paul D. Smith <psmith>
Group administrator
Sun 29 Mar 2020 01:35:17 PM UTC, original submission:  

Hopefully someone can make this update

diff --git a/src/getopt.c b/src/getopt.c
index 35e71ef..e0647ae 100644
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -677,6 +677,7 @@ _getopt_internal (int argc, char *const *argv, const char *optstring,
              else
                {
                  if (opterr)
+                  {
                   if (argv[optind - 1][1] == '-')
                    /* --option */
                    fprintf (stderr,
@@ -687,6 +688,7 @@ _getopt_internal (int argc, char *const *argv, const char *optstring,
                    fprintf (stderr,
                     _("%s: option '%c%s' doesn't allow an argument\n"),
                     argv[0], argv[optind - 1][0], pfound->name);
+                  }
 
                  nextchar += strlen (nextchar);
 

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-09 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.4.1
        Triage StatusNone Small Effort
    2021-12-24 psmith Summarycompiler warning: add explicit braces to avoid dangling else getopt.c: compiler warning: add explicit braces to avoid dangling else

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code