Skip to content

Commit 59c882b

Browse files
authored
Merge pull request diffblue#1294 from diffblue/goto-gcc-fix
fix verbosity in goto-gcc
2 parents b2397e4 + 433e139 commit 59c882b

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

regression/goto-gcc/verbosity1/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
int main()
2+
{
3+
return 0;
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.c
3+
--version
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^RUN: .* --version
8+
^warning: ignoring
9+
^CONVERSION ERROR$

regression/goto-gcc/verbosity2/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
int main()
2+
{
3+
return 0;
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.c
3+
--version --verbosity 10
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^RUN: .* --version
7+
--
8+
^warning: ignoring
9+
^CONVERSION ERROR$

src/goto-cc/gcc_mode.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,14 @@ int gcc_modet::doit()
333333

334334
unsigned int verbosity=1;
335335

336+
if(cmdline.isset("Wall") || cmdline.isset("Wextra"))
337+
verbosity=2;
338+
339+
if(cmdline.isset("verbosity"))
340+
verbosity=unsafe_string2unsigned(cmdline.get_value("verbosity"));
341+
342+
gcc_message_handler.set_verbosity(verbosity);
343+
336344
bool act_as_bcc=
337345
base_name=="bcc" ||
338346
base_name.find("goto-bcc")!=std::string::npos;
@@ -381,14 +389,6 @@ int gcc_modet::doit()
381389
return EX_OK;
382390
}
383391

384-
if(cmdline.isset("Wall") || cmdline.isset("Wextra"))
385-
verbosity=2;
386-
387-
if(cmdline.isset("verbosity"))
388-
verbosity=unsafe_string2unsigned(cmdline.get_value("verbosity"));
389-
390-
gcc_message_handler.set_verbosity(verbosity);
391-
392392
if(act_as_ld)
393393
{
394394
if(produce_hybrid_binary)

0 commit comments

Comments
 (0)