Strange Eiffel error messages with tutorial/example1
Thomas Preymesser <[email protected]> Mon, 20 Sep 2010 15:10:32 +0200
| Newsgroups | gmane.comp.lang.eiffel.smalleiffel |
|---|---|
| Message-ID | <[email protected]> |
--00c09f89958956d2940490b0a464
Content-Type: text/plain; charset=ISO-8859-1
Hello,
a few weeks ago i installed SmartEiffel Release 2.3 on my Windows 7 Starter
Netbook. All programs that i wrote
compiled well.
But then i tried to compile the example1 programm im the tutorial/xml
directory and got these strange errors:
cpp: show_xml1.c:4698 Macro redefinition of MAKEWORD, previously defined in
c:\lcc\include\win.h 547
Warning show_xml1.c: 4724 sprintf: too many arguments
Warning show_xml1.c: 4785 missing prototype for fcntl
Warning show_xml1.c: 4785 Missing prototype for 'fcntl'
Error show_xml1.c: 4785 undeclared identifier 'F_GETFL'
Error show_xml1.c: 4786 undeclared identifier 'O_NONBLOCK'
Warning show_xml1.c: 4787 Missing prototype for 'fcntl'
Error show_xml1.c: 4787 undeclared identifier 'F_SETFL'
Warning show_xml1.c: 4787 possible usage of F_SETFL before definition
Warning show_xml1.c: 4786 possible usage of O_NONBLOCK before definition
Warning show_xml1.c: 4785 possible usage of F_GETFL before definition
Warning show_xml1.c: 4801 missing prototype for fcntl
Warning show_xml1.c: 4801 Missing prototype for 'fcntl'
Error show_xml1.c: 4801 undeclared identifier 'F_GETFL'
Error show_xml1.c: 4802 undeclared identifier 'O_NONBLOCK'
Warning show_xml1.c: 4803 Missing prototype for 'fcntl'
Error show_xml1.c: 4803 undeclared identifier 'F_SETFL'
Warning show_xml1.c: 4803 possible usage of F_SETFL before definition
Warning show_xml1.c: 4802 possible usage of O_NONBLOCK before definition
Warning show_xml1.c: 4801 possible usage of F_GETFL before definition
Warning show_xml1.c: 4831 Missing prototype for 'net_tcp_socket'
Warning show_xml1.c: 4842 Missing prototype for 'net_udp_socket'
Error show_xml1.c: 4890 undeclared identifier 'SD_BOTH'
Warning show_xml1.c: 4890 possible usage of SD_BOTH before definition
Warning show_xml1.c: 4976 Missing prototype for 'net_tcp_socket'
Warning show_xml1.c: 4984 Missing prototype for 'net_udp_socket'
7 errors, 19 warnings
This is the source of the program:
class SHOW_XML
--
-- This simple example just uses XML_TREE.
--
-- See EXAMPLE2 on how to extend XML_TREE to add validation features.
--
insert
ARGUMENTS
create {}
make
feature {}
make is
local
in: TEXT_FILE_READ
tree: XML_TREE
version: STRING
do
-- first create the stream
create in.connect_to(argument(1))
if in.is_connected then
-- then create the tree
create tree.with_error_handler(in, agent error)
-- now display the results
-- version := tree.attribute_at(once "version")
if version /= Void then
io.put_string(once "XML version: ")
io.put_string(version)
io.put_new_line
end
display_node(tree.root, 0)
end
end
display_node (node: XML_NODE; indent: INTEGER) is
local
i: INTEGER
do
from
i := 1
until
i > indent
loop
io.put_string(once " ")
i := i + 1
end
io.put_string(node.name)
if node.attributes_count > 0 then
io.put_character('(')
from
i := 1
until
i > node.attributes_count
loop
if i > 1 then
io.put_string(once ", ")
end
io.put_string(node.attribute_name(i))
io.put_character('=')
io.put_string(node.attribute_value(i))
i := i + 1
end
io.put_character(')')
end
io.put_new_line
from
i := 1
until
i > node.children_count
loop
display_node(node.child(i), indent + 1)
i := i + 1
end
end
error (line, column: INTEGER) is
do
std_error.put_string(once "Error at ")
std_error.put_integer(line)
std_error.put_string(once ", ")
std_error.put_integer(column)
std_error.put_string(once "!%N")
die_with_code(1)
end
end
I tried to find out which statement causes the error. I disabled the line
"create tree.with_error_handler(in, agent error)". The program compiled now,
but of course it can not work properly without this statement.
Does anybody know, why i am getting these errors? What can i do?
-Thomas
--
Thomas Preymesser
[email protected]
http://thopre.googlepages.com/
http://thopre.wordpress.com/
--00c09f89958956d2940490b0a464
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hello,<br><br>a few weeks ago i installed SmartEiffel Release 2.3 on my Win=
dows 7 Starter Netbook. All programs that i wrote<br>compiled well.<br>But =
then i tried to compile the example1 programm im the tutorial/xml directory=
and got these strange errors:<br>
<br>cpp: show_xml1.c:4698 Macro redefinition of MAKEWORD, previously define=
d in c:\lcc\include\win.h 547<br>Warning show_xml1.c: 4724=A0 sprintf: too =
many arguments<br>Warning show_xml1.c: 4785=A0 missing prototype for fcntl<=
br>
Warning show_xml1.c: 4785=A0 Missing prototype for 'fcntl'<br>Error=
show_xml1.c: 4785=A0 undeclared identifier 'F_GETFL'<br>Error show=
_xml1.c: 4786=A0 undeclared identifier 'O_NONBLOCK'<br>Warning show=
_xml1.c: 4787=A0 Missing prototype for 'fcntl'<br>
Error show_xml1.c: 4787=A0 undeclared identifier 'F_SETFL'<br>Warni=
ng show_xml1.c: 4787=A0 possible usage of F_SETFL before definition<br>Warn=
ing show_xml1.c: 4786=A0 possible usage of O_NONBLOCK before definition<br>=
Warning show_xml1.c: 4785=A0 possible usage of F_GETFL before definition<br=
>
Warning show_xml1.c: 4801=A0 missing prototype for fcntl<br>Warning show_xm=
l1.c: 4801=A0 Missing prototype for 'fcntl'<br>Error show_xml1.c: 4=
801=A0 undeclared identifier 'F_GETFL'<br>Error show_xml1.c: 4802=
=A0 undeclared identifier 'O_NONBLOCK'<br>
Warning show_xml1.c: 4803=A0 Missing prototype for 'fcntl'<br>Error=
show_xml1.c: 4803=A0 undeclared identifier 'F_SETFL'<br>Warning sh=
ow_xml1.c: 4803=A0 possible usage of F_SETFL before definition<br>Warning s=
how_xml1.c: 4802=A0 possible usage of O_NONBLOCK before definition<br>
Warning show_xml1.c: 4801=A0 possible usage of F_GETFL before definition<br=
>Warning show_xml1.c: 4831=A0 Missing prototype for 'net_tcp_socket'=
;<br>Warning show_xml1.c: 4842=A0 Missing prototype for 'net_udp_socket=
'<br>
Error show_xml1.c: 4890=A0 undeclared identifier 'SD_BOTH'<br>Warni=
ng show_xml1.c: 4890=A0 possible usage of SD_BOTH before definition<br>Warn=
ing show_xml1.c: 4976=A0 Missing prototype for 'net_tcp_socket'<br>=
Warning show_xml1.c: 4984=A0 Missing prototype for 'net_udp_socket'=
<br>
7 errors, 19 warnings<br><br>This is the source of the program:<br><br>clas=
s SHOW_XML<br>--<br>-- This simple example just uses XML_TREE.<br>--<br>-- =
See EXAMPLE2 on how to extend XML_TREE to add validation features.<br>
--<br>
insert<br>=A0=A0=A0 ARGUMENTS<br><br>create {}<br>=A0=A0=A0 make<br><br>fea=
ture {}<br>=A0=A0=A0 make is<br>=A0=A0=A0 =A0=A0=A0 local<br>=A0=A0=A0 =A0=
=A0=A0 =A0=A0=A0 in: TEXT_FILE_READ<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 tree: =
XML_TREE<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 version: STRING<br>=A0=A0=A0 =A0=
=A0=A0 do<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 -- first create the stream<br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 create in.connect_to(argument(1))<br>=A0=A0=
=A0 =A0=A0=A0 =A0=A0=A0 if in.is_connected then<br>=A0=A0=A0 =A0=A0=A0 =A0=
=A0=A0 =A0=A0=A0 -- then create the tree<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =
=A0=A0=A0 create tree.with_error_handler(in, agent error)<br>=A0=A0=A0 =A0=
=A0=A0 =A0=A0=A0 =A0=A0=A0 -- now display the results<br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 -- version :=3D tree.attribute_at(o=
nce "version")<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 if vers=
ion /=3D Void then<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 io.=
put_string(once "XML version: ")<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=
=A0=A0=A0 =A0=A0=A0 io.put_string(version)<br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 io.put_new_line<br>=A0=A0=
=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 end<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=
=A0=A0 display_node(tree.root, 0)<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 end<br>=
=A0=A0=A0 =A0=A0=A0 end<br><br>=A0=A0=A0 display_node (node: XML_NODE; inde=
nt: INTEGER) is<br>=A0=A0=A0 =A0=A0=A0 local<br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 i: INTEGER<br>
=A0=A0=A0 =A0=A0=A0 do<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 from<br>=A0=A0=A0 =
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 i :=3D 1<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 unt=
il<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 i > indent<br>=A0=A0=A0 =
=A0=A0=A0 =A0=A0=A0 loop<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 io.put_=
string(once "=A0 ")<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 i =
:=3D i + 1<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 end<br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 io.put_string(<a href=3D"http://node.name">no=
de.name</a>)<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 if node.attributes_count >=
0 then<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 io.put_character('(&=
#39;)<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 from<br>=A0=A0=A0 =A0=A0=
=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 i :=3D 1<br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 until<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=
=A0 =A0=A0=A0 =A0=A0=A0 i > node.attributes_count<br>=A0=A0=A0 =A0=A0=A0=
=A0=A0=A0 =A0=A0=A0 loop<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=
=A0 if i > 1 then<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =
=A0=A0=A0 io.put_string(once ", ")<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=
=A0 =A0=A0=A0 =A0=A0=A0 end<br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 io.put_string(node.attrib=
ute_name(i))<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 io.put_ch=
aracter('=3D')<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=
io.put_string(node.attribute_value(i))<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =
=A0=A0=A0 =A0=A0=A0 i :=3D i + 1<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=
end<br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 io.put_character(')')<br>=
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 end<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 io.put_n=
ew_line<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 from<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=
=A0 =A0=A0=A0 i :=3D 1<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 until<br>=A0=A0=A0 =
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 i > node.children_count<br>=A0=A0=A0 =A0=
=A0=A0 =A0=A0=A0 loop<br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 display_node(node.child(i), indent =
+ 1)<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 i :=3D i + 1<br>=A0=A0=A0 =
=A0=A0=A0 =A0=A0=A0 end<br>=A0=A0=A0 =A0=A0=A0 end<br><br>=A0=A0=A0 error (=
line, column: INTEGER) is<br>=A0=A0=A0 =A0=A0=A0 do<br>=A0=A0=A0 =A0=A0=A0 =
=A0=A0=A0 std_error.put_string(once "Error at ")<br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 std_error.put_integer(line)<br>=A0=A0=A0 =A0=
=A0=A0 =A0=A0=A0 std_error.put_string(once ", ")<br>=A0=A0=A0 =A0=
=A0=A0 =A0=A0=A0 std_error.put_integer(column)<br>=A0=A0=A0 =A0=A0=A0 =A0=
=A0=A0 std_error.put_string(once "!%N")<br>=A0=A0=A0 =A0=A0=A0 =
=A0=A0=A0 die_with_code(1)<br>
=A0=A0=A0 =A0=A0=A0 end<br><br>end<br><br>I tried to find out which stateme=
nt causes the error. I disabled the line<br>"create tree.with_error_ha=
ndler(in, agent error)". The program compiled now, but of course it ca=
n not work properly without this statement.<br>
<br>Does anybody know, why i am getting these errors?=A0 What can i do?<br>=
<br>-Thomas<br><br clear=3D"all"><br>-- <br>Thomas Preymesser<br><a href=3D=
"mailto:[email protected]">[email protected]</a><br><a href=3D"http://thopre.=
googlepages.com/">http://thopre.googlepages.com/</a><br>
<a href=3D"http://thopre.wordpress.com/">http://thopre.wordpress.com/</a><b=
r>
--00c09f89958956d2940490b0a464--