[prev in list] [next in list] [prev in thread] [next in thread]
List: quagga-dev
Subject: [quagga-dev 14719] Re: [PATCH 2/3] isisd: fix assert warning
From: Donald Sharp <sharpd () cumulusnetworks ! com>
Date: 2016-02-23 13:01:25
Message-ID: CAK989ycC02kC=P49Jicb5ot0Sib3HjQUJ_hVUsHxriZogpngsA () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Do we forsee a future where we modify this behavior of assert? If so then
I would make it a requirement of the person doing that work to go and fix
all assert code. I'm not sure I want to worry about this at this point in
time.
So this 'hack' to make the compiler happy is ok with me.
donald
On Tue, Feb 16, 2016 at 1:50 PM, David Lamparter <
equinox@opensourcerouting.org> wrote:
> icc (the Intel C Compiler) "knows" that assert() can be disabled by
> setting specific optimisation flags, and therefore emits a warning about
> missing a return value after an "always-error" assert.
>
> Workaround by returning a value - this probably needs discussion and a
> better fix (for all places where the code needs to abort due to internal
> errors).
>
> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
> ---
> isisd/isis_redist.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/isisd/isis_redist.c b/isisd/isis_redist.c
> index abb9ecd..552613a 100644
> --- a/isisd/isis_redist.c
> +++ b/isisd/isis_redist.c
> @@ -52,6 +52,7 @@ redist_protocol(int family)
> return 1;
>
> assert(!"Unsupported address family!");
> + return 0;
> }
>
> static int
> --
> 2.3.6
>
>
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev@lists.quagga.net
> https://lists.quagga.net/mailman/listinfo/quagga-dev
>
[Attachment #5 (text/html)]
<div dir="ltr">Do we forsee a future where we modify this behavior of assert? If so \
then I would make it a requirement of the person doing that work to go and fix all \
assert code. I'm not sure I want to worry about this at this point in time. \
<div><br></div><div>So this 'hack' to make the compiler happy is ok with \
me.</div><div><br></div><div>donald</div></div><div class="gmail_extra"><br><div \
class="gmail_quote">On Tue, Feb 16, 2016 at 1:50 PM, David Lamparter <span \
dir="ltr"><<a href="mailto:equinox@opensourcerouting.org" \
target="_blank">equinox@opensourcerouting.org</a>></span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">icc (the Intel C Compiler) "knows" that assert() \
can be disabled by<br> setting specific optimisation flags, and therefore emits a \
warning about<br> missing a return value after an "always-error" \
assert.<br> <br>
Workaround by returning a value - this probably needs discussion and a<br>
better fix (for all places where the code needs to abort due to internal<br>
errors).<br>
<br>
Signed-off-by: David Lamparter <<a \
href="mailto:equinox@opensourcerouting.org">equinox@opensourcerouting.org</a>><br>
---<br>
isisd/isis_redist.c | 1 +<br>
1 file changed, 1 insertion(+)<br>
<br>
diff --git a/isisd/isis_redist.c b/isisd/isis_redist.c<br>
index abb9ecd..552613a 100644<br>
--- a/isisd/isis_redist.c<br>
+++ b/isisd/isis_redist.c<br>
@@ -52,6 +52,7 @@ redist_protocol(int family)<br>
return 1;<br>
<br>
assert(!"Unsupported address family!");<br>
+ return 0;<br>
}<br>
<br>
static int<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.3.6<br>
<br>
<br>
_______________________________________________<br>
Quagga-dev mailing list<br>
<a href="mailto:Quagga-dev@lists.quagga.net">Quagga-dev@lists.quagga.net</a><br>
<a href="https://lists.quagga.net/mailman/listinfo/quagga-dev" rel="noreferrer" \
target="_blank">https://lists.quagga.net/mailman/listinfo/quagga-dev</a><br> \
</font></span></blockquote></div><br></div>
_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic