Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
d6daa787
Commit
d6daa787
authored
Oct 05, 2010
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opt: fix warnings with gcc and -O.
parent
be6a5cda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ccan/opt/opt.c
ccan/opt/opt.c
+3
-3
No files found.
ccan/opt/opt.c
View file @
d6daa787
...
@@ -83,7 +83,7 @@ static const char *next_lopt(const char *p, unsigned *i, unsigned *len)
...
@@ -83,7 +83,7 @@ static const char *next_lopt(const char *p, unsigned *i, unsigned *len)
const
char
*
first_sopt
(
unsigned
*
i
)
const
char
*
first_sopt
(
unsigned
*
i
)
{
{
const
char
*
p
;
const
char
*
p
;
unsigned
int
len
;
unsigned
int
len
=
0
/* GCC bogus warning */
;
for
(
p
=
first_opt
(
i
,
&
len
);
p
;
p
=
next_opt
(
p
,
i
,
&
len
))
{
for
(
p
=
first_opt
(
i
,
&
len
);
p
;
p
=
next_opt
(
p
,
i
,
&
len
))
{
if
(
p
[
0
]
!=
'-'
)
if
(
p
[
0
]
!=
'-'
)
...
@@ -215,7 +215,7 @@ static char *make_optstring(void)
...
@@ -215,7 +215,7 @@ static char *make_optstring(void)
static
struct
option
*
make_options
(
void
)
static
struct
option
*
make_options
(
void
)
{
{
struct
option
*
options
=
malloc
(
sizeof
(
*
options
)
*
(
opt_num_long
+
1
));
struct
option
*
options
=
malloc
(
sizeof
(
*
options
)
*
(
opt_num_long
+
1
));
unsigned
int
i
,
num
=
0
,
len
;
unsigned
int
i
,
num
=
0
,
len
=
0
/* GCC bogus warning */
;
const
char
*
p
;
const
char
*
p
;
for
(
p
=
first_lopt
(
&
i
,
&
len
);
p
;
p
=
next_lopt
(
p
,
&
i
,
&
len
))
{
for
(
p
=
first_lopt
(
&
i
,
&
len
);
p
;
p
=
next_lopt
(
p
,
&
i
,
&
len
))
{
...
@@ -296,7 +296,7 @@ bool opt_parse(int *argc, char *argv[], void (*errlog)(const char *fmt, ...))
...
@@ -296,7 +296,7 @@ bool opt_parse(int *argc, char *argv[], void (*errlog)(const char *fmt, ...))
while
((
ret
=
getopt_long
(
*
argc
,
argv
,
optstring
,
options
,
&
longidx
))
while
((
ret
=
getopt_long
(
*
argc
,
argv
,
optstring
,
options
,
&
longidx
))
!=
-
1
)
{
!=
-
1
)
{
char
*
problem
;
char
*
problem
;
const
char
*
name
;
const
char
*
name
=
NULL
;
/* GCC bogus warning */
/* optopt is 0 if it's an unknown long option, *or* if
/* optopt is 0 if it's an unknown long option, *or* if
* -? is a valid short option. */
* -? is a valid short option. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment