Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include "err.h" to be able to use warnx() #3

Merged
merged 1 commit into from Jun 4, 2015

Conversation

vincentbernat
Copy link
Contributor

Otherwise, we get a warning about warnx() not being defined.

@vincentbernat
Copy link
Contributor Author

More generally, there are a lot of other warnings:

../../src/argtable3/argtable3.c:2839:9: warning: variable 'errorcode' set but not used [-Wunused-but-set-variable]
     int errorcode, i;
../../src/argtable3/argtable3.c: In function 'trex_element':
../../src/argtable3/argtable3.c:3183:7: warning: variable 'op' set but not used [-Wunused-but-set-variable]
   int op;
       ^
../../src/argtable3/argtable3.c: In function 'trex_matchnode':
../../src/argtable3/argtable3.c:3419:23: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   if(str == exp->_bol && !isspace(*str)
                       ^
../../src/argtable3/argtable3.c:3433:3: warning: value computed is not used [-Wunused-value]
   *str++;
   ^
../../src/argtable3/argtable3.c:3439:4: warning: value computed is not used [-Wunused-value]
    *str++;
    ^
../../src/argtable3/argtable3.c:3445:4: warning: value computed is not used [-Wunused-value]
    *str++;
    ^
../../src/argtable3/argtable3.c:3458:3: warning: value computed is not used [-Wunused-value]
   *str++;
   ^
../../src/argtable3/argtable3.c: In function 'trex_searchrange':
../../src/argtable3/argtable3.c:3549:3: warning: value computed is not used [-Wunused-value]
   *text_begin++;
   ^
../../src/argtable3/argtable3.c: At top level:
../../src/argtable3/argtable3.c:3842:6: warning: 'dump_longoptions' defined but not used [-Wunused-function]
 void dump_longoptions(struct longoptions * longoptions)
      ^

@vincentbernat
Copy link
Contributor Author

The warnings about *str++ are here because *str++ is *(str++) which doesn't seem right. So it should be (*str)++ but that doesn't seem right either (why would we do that). I suppose this should str++.

@vincentbernat
Copy link
Contributor Author

I'll do a global pull requests with proposed fixes.

@vincentbernat
Copy link
Contributor Author

Well, the other pull request didn't include the fix for warnx(). So, let's reopen this one.

@vincentbernat vincentbernat reopened this Dec 7, 2014
tomghuang added a commit that referenced this pull request Jun 4, 2015
Include "err.h" to be able to use `warnx()`
@tomghuang tomghuang merged commit 4f8fc7f into argtable:master Jun 4, 2015
tomghuang pushed a commit that referenced this pull request Mar 15, 2019
MAN-383: Restore __linux__ test for err.h inclusion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants