Discussion:
[Bug-apl] apl 1.7 Symbol.cc compile bug
carl hansen
2017-03-19 02:36:27 UTC
Permalink
g++ -DHAVE_CONFIG_H -I. -I.. -Werror -Wall -I sql -I/usr/include
-I/usr/include/postgresql -rdynamic -g -O2 -MT apl-SymbolTable.o -MD -MP
-MF .deps/apl-SymbolTable.Tpo -c -o apl-SymbolTable.o `test -f
'SymbolTable.cc' || echo './'`SymbolTable.cc
In file included from Simple_string.hh:33:0,
from CDR_string.hh:24,
from CDR.hh:24,
from Symbol.cc:24:
Symbol.cc: In member function 'void Symbol::set_nc(NameClass, Function*)':
Symbol.cc:888:32: error: enum constant in boolean context
[-Werror=int-in-bool-context]
Assert(nc == NC_FUNCTION || NC_OPERATOR || NC_UNUSED_USER_NAME);
^
line 888 Symbol.cc

Assert(nc == NC_FUNCTION || NC_OPERATOR || NC_UNUSED_USER_NAME);
This is parsed by precedence rules as :
Assert ( (nc == NC_FUNCTION ) || NC_OPERATOR || NC_UNUSED_USER_NAME);

should it be:
Assert(nc == NC_FUNCTION || nc == NC_OPERATOR || nc ==
NC_UNUSED_USER_NAME);

?
In which case it compiles without complaint.
gcc 7
Juergen Sauermann
2017-03-19 10:42:41 UTC
Permalink
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Helvetica, Arial, sans-serif">Hi Carl,<br>
<br>
thanks. Fixed in <b>SVN 908</b>.<br>
<br>
/// Jürgen<br>
<br>
</font><br>
<div class="moz-cite-prefix">On 03/19/2017 03:36 AM, carl hansen
wrote:<br>
</div>
<blockquote
cite="mid:CAHEkXCR9CmPeMSkG3Gie4D7Ny6k8zS+***@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_default"
style="font-family:monospace,monospace">g++ -DHAVE_CONFIG_H
-I. -I..    -Werror -Wall -I sql -I/usr/include
-I/usr/include/postgresql  -rdynamic -g -O2 -MT
apl-SymbolTable.o -MD -MP -MF .deps/apl-SymbolTable.Tpo -c -o
apl-SymbolTable.o `test -f 'SymbolTable.cc' || echo
'./'`SymbolTable.cc<br>
In file included from Simple_string.hh:33:0,<br>
                 from CDR_string.hh:24,<br>
                 from CDR.hh:24,<br>
                 from Symbol.cc:24:<br>
Symbol.cc: In member function 'void Symbol::set_nc(NameClass,
Function*)':<br>
Symbol.cc:888:32: error: enum constant in boolean context
[-Werror=int-in-bool-context]<br>
    Assert(nc == NC_FUNCTION || NC_OPERATOR ||
NC_UNUSED_USER_NAME);<br>
                              <wbr>  ^<br>
</div>
<div class="gmail_default"
style="font-family:monospace,monospace">line 888 Symbol.cc<br>
<br>
    Assert(nc == NC_FUNCTION || NC_OPERATOR ||
NC_UNUSED_USER_NAME);<br>
This is parsed by precedence rules as :<br>
</div>
<div class="gmail_default"
style="font-family:monospace,monospace">     Assert ( (nc ==
NC_FUNCTION ) || NC_OPERATOR || NC_UNUSED_USER_NAME);<br>
<br>
</div>
<div class="gmail_default"
style="font-family:monospace,monospace">should it be:<br>
</div>
<div class="gmail_default"
style="font-family:monospace,monospace">    Assert(nc ==
NC_FUNCTION || nc == NC_OPERATOR || nc ==
NC_UNUSED_USER_NAME);<br>
 <br>
?<br>
</div>
<div class="gmail_default"
style="font-family:monospace,monospace">In which case it
compiles without complaint.<br>
</div>
<div class="gmail_default"
style="font-family:monospace,monospace">gcc 7<br>
</div>
<div class="gmail_default"
style="font-family:monospace,monospace"><br>
</div>
</div>
</blockquote>
<br>
</body>
</html>

Loading...