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  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Originator Name: Open/Closed: Open

Add a New Comment (Rich MarkupRich 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:

$ 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

$ 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 File(s):

Attached Files
file #32485:  02unusedvariables.patch added by jlguardi (2kB - 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
  • -unavailable- added by jlguardi (Updated the item)
  • -unavailable- added by edwintorok (Submitted the item)
  • -unavailable- added by edwintorok

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

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 20 Nov 2014 11:14:21 AM UTCjlguardiAttached File-=>Added 02unusedvariables.patch, #32485
    Fri 11 Oct 2013 04:28:39 PM UTCedwintorokCarbon-Copy-=>Added edwintorok

    Back to the top

    Powered by Savane 3.1-cleanup