Added to my queue.  Thanks.

-- Murphy

On Feb 28, 2012, at 10:28 AM, Martin Fong wrote:

>     When compiling nox-destiny src/builtin/nox.cc with -O0, g++
> _correctly_ reports the syntax error
> 
>    ../../../src/builtin/nox.cc: In member function `void 
> vigil::nox::Handshake_fsm::handle_vendor(std::auto_ptr<vigil::Buffer>)':
>    ../../../src/builtin/nox.cc:1037: error: expected `(' before `ntohs'
>    [Snip.]
> 
> (However, there is _no_ compilation error when this file is compiled
> with -O[12].)
> 
>     Given that nox.cc:1037 is
> 
>    switch ntohs(ofmph->type) {
> 
> (which is syntactically illegal -- the switch expression must be
> delimited by left and right parentheses), with -O[12]. there is no
> compilation error because ntohs(ofmph->type) is replaced with an
> inline expression that is enclosed by left and right parentheses --
> and this implicitly _corrects_ the syntax error(!).
> 
>     Could someone please correct nox.cc in the source code
> distribution?
> 
>     Thanks!
> 
>     ...Martin Fong
> 
> =====
> 
> diff --git a/src/builtin/nox.cc b/src/builtin/nox.cc
> index 71b2b8d..5867f31 100644
> --- a/src/builtin/nox.cc
> +++ b/src/builtin/nox.cc
> @@ -1034,7 +1034,7 @@ void Handshake_fsm::handle_vendor(std::auto_ptr<Buffer> 
> buf)
>                 }
>             }
> 
> -            switch ntohs(ofmph->type) {
> +            switch (ntohs(ofmph->type)) {
>             case OFMPT_CAPABILITY_REPLY: {
>                     if(state != RECV_MGMT_CAPABILITY_REPLY) {
>                       lg.warn("Ignoring mgmt capability reply "
> 
> _______________________________________________
> nox-dev mailing list
> nox-dev@noxrepo.org
> http://noxrepo.org/mailman/listinfo/nox-dev

_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev

Reply via email to