Setting Warnings

33 views
Skip to first unread message

Nadilma

unread,
May 28, 2012, 9:06:55 AM5/28/12
to ns-3-users
When I use the command ". / Waf - run scratch / myExample", some
warnings are generated. However, these warnings are understood as an
error and does not give me the expected result. Warnings should not be
considered errors. Does anyone know why this happens? Is there any
setting to adjust this problem?

Nadilma Nunes

unread,
Jun 1, 2012, 7:57:56 PM6/1/12
to ns-3-users
Anyone know anything about this?


--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.




--
Nadilma Nunes.

Mitch Watrous

unread,
Jun 2, 2012, 6:15:41 PM6/2/12
to ns-3-users
Compiler warnings are being treated as errors.

Google about "treat compiler warnings as errors" to see the kinds of
errors that cause these messages.

Try to fix the warnings in your code to make this problem go away.

If that is not possible, can you send the warning messages you are
getting and your code?

Mitch

Nadilma Nunes

unread,
Jun 8, 2012, 2:01:08 PM6/8/12
to ns-3-...@googlegroups.com
Hi Mitch,

I fixed the  warnings in my code.
But I want treat compiler warnings not as error with a kind of setting. Do you understand me?
So, yes I took all the lines that cause warnings and worked.

Nadilma Nunes

unread,
Jun 8, 2012, 2:01:28 PM6/8/12
to ns-3-...@googlegroups.com
Thanks.
--
Nadilma Nunes.

Shoban

unread,
Jun 8, 2012, 8:52:00 PM6/8/12
to ns-3-...@googlegroups.com
Hi Nadilma,
If you want to treat the warnings as not error, do you want to compile the code with warnings and run?

Nadilma Nunes

unread,
Jun 11, 2012, 11:53:22 AM6/11/12
to ns-3-...@googlegroups.com
Hi Shoban,

that was what I wanted, because most modern compilers give warnings but even so the code runs. Warnings are not errors. Do you understand me?
But I commented the code lines that cause warnings, and it works.

Shoban Raj

unread,
Jun 12, 2012, 5:10:42 PM6/12/12
to ns-3-...@googlegroups.com
Hi,

Yes, warnings are not errors. But, it always better to have the code that doesn't have any warnings or errors, since it may cause some problem in runtime. Also, you are relying on the results from the simulation produced by your code, it is always better to have code that doesn't have even minor mistakes. Anyway if you are confident that your code produces reliable results even with compiler warnings, you can do the following to stop the compiler to treat the warnings as error,

Open the file  waf-tool/cflags.py the you can see the following code,

class GccTraits(CompilerTraits):
def __init__(self):
super(GccTraits, self).__init__()
# cumulative list of warnings per level
self.warnings_flags = [['-Wall'], ['-Werror'], ['-Wextra']]

Remove the '-Werror' in the last line and save.
Then you have to configure and build the NS3 as you have done initially.

Regards,
Shoban.

Nadilma Nunes

unread,
Jun 13, 2012, 1:26:11 PM6/13/12
to ns-3-...@googlegroups.com
Thanks.
Reply all
Reply to author
Forward
0 new messages