bugGNU Gengetopt - Bugs: bug #40243, please fix...

 
 

bug #40243: please fix -Wunused-but-set-variable warnings in generated code

Submitted by:  Török Edwin <edwintorok>
Submitted on:  Fri 11 Oct 2013 04:28:39 PM UTC  
Votes:  100  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 20 Nov 2014 11:14:21 AM UTC, comment #1:

I propose attached patch to fix this compilation warnings.

I've fixed these three warnings but probably more warnings could be produced with other kind of parameters.

(file #32485)

Jose Luis Guardiola <jlguardi>
Fri 11 Oct 2013 04:28:39 PM UTC, original submission:

Testcase:
$ cat >warningtest.ggo <<EOF
package "warningtest"
purpose "Should get not warnings with -Wall"
args "--unamed-opts --no-handle-version --strict-hidden"
usage "warningtest [OPTIONS]"

option "verbose" v "Enable verbose messages" flag off
EOF

$ gengetopt <warningtest.ggo && gcc -c cmdline.c -DVERSION=\"test\" -Wall
cmdline.c: In function ‘update_arg’:
cmdline.c:335:15: warning: variable ‘val’ set but not used [-Wunused-but-set-variable]
const char *val = value;
^
cmdline.c:334:9: warning: variable ‘stop_char’ set but not used [-Wunused-but-set-variable]
char *stop_char = 0;
^
cmdline.c: In function ‘cmdline_parser_internal’:
cmdline.c:408:7: warning: variable ‘check_required’ set but not used [-Wunused-but-set-variable]
int check_required;
^

Török Edwin <edwintorok>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #32485:  02unusedvariables.patch added by jlguardi (2KiB - text/x-diff - patch to fix unused variables warning)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by superluigi (Voted in favor of this item)
  • -email is unavailable- added by jlguardi (Updated the item)
  • -email is unavailable- added by edwintorok (Submitted the item)
  • -email is unavailable- added by edwintorok
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 100 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-05 superluigi Carbon-Copy- => Added superluigi
    2014-11-20 jlguardi Attached File- => Added 02unusedvariables.patch, #32485
    2013-10-11 edwintorok Carbon-Copy- => Added edwintorok

    Back to the top


    Powered by Savane 3.3