| Newsgroups |
gmane.comp.lang.eiffel.gobo.general |
| Message-ID |
<[email protected]> |
--------------DC01133F6B827A3A6A6C2175
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Thanks Eric. The problem was that I stupidly replace this (using Liberty
Eiffel):
=C2=A0=C2=A0=C2=A0 if p.is_not_null then
whit
=C2=A0=C2=A0=C2=A0 if p /=3D Void then
or with:
=C2=A0=C2=A0=C2=A0 if attached ....
which of course are not equivalent.
Now all the examples run without problem. But I still have to update the
tutorial.
Thanks.
Germ=C3=A1n.
On 11/8/19 2:07 PM, Eric Bezault ericb-D6Qt/9opevxWk0Htik3J/[email protected] [gobo-eiffel] wrote:
>
> Hi Germ=C3=A0n,
>
> Without seeing your code, it's hard to say, but I would suspect
> that when you write:
>
> if attached get_string as p then
>
> `get_string` is of type POINTER. If so, then you should know that
> POINTER is an expanded class, and therefore can never be void.
> So `attached get_string` will always return True. It's as if you
> write:
>
> get_string /=3D Void
>
> It's not different from:
>
> int :=3D 0
> if attached int as i then
>
> This will always return True because an INTEGER is never Void.
> In case of INTEGER, we have:
>
> attached int -> True
> int /=3D Void -> True
> int /=3D 0 -> False
>
> In case of POINTER we have:
>
> attached get_string -> True
> get_string /=3D Void -> True
> get_string /=3D default_pointer -> False
> get_string.is_default_pointer -> True
>
> --
> Eric Bezault
> mailto:ericb-D6Qt/9opevxWk0Htik3J/[email protected]
> http://www.gobosoft.com
>
> On 08/11/2019 20:36, Germ=C3=A1n Arias [email protected] [gobo-eiffel] w=
rote:
> > Hi,
> >
> > Attached is a simple Void test. As you can see the c function return a
> > char that is not attached. However it pass the test "attached get_strin=
g
> > as p then". With gec it compiles and run without problem. The output is=
:
> >
> > [german@localhost void-test]$ ./void_test
> > p is attached.
> > 0x402482
> > UH=EF=BF=BD=EF=BF=BDH=EF=BF=BDE=EF=BF=BD]=EF=BF=BDUH=EF=BF=BD=EF=BF=BDH=
=EF=BF=BD=EF=BF=BD =EF=BF=BD=EF=BF=BD=EF=BF=BDE=EF=BF=BD
> >
> > With ISE (C inline is different but is the same C function) it compiles
> > but crash at run time. The output is:
> >
> > [german@localhost void-test]$ ./void_test
> > p is attached.
> > 0x0
> >
> > void_test: system execution failed.
> > Following is the set of recorded exceptions:
> >
> > ******************************** Thread exception
> > *****************************
> > In thread=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 R=
oot thread=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 0x0 (thread id)
> >
> *************************************************************************=
******
> > ----------------------------------------------------------
> > Class / Object=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Routine=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Na=
ture of exception
> > Effect
> > ----------------------------------------------------------
> > VOID_TEST=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 r=
oot's creation Segmentation fault:
> > <00007F574488E558> Operating system signal.
> > Exit
> > ----------------------------------------------------------
> > VOID_TEST=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 r=
oot's creation
> > <00007F574488E558> Routine failure.
> > Exit
> > ----------------------------------------------------------
> >
> > As far as I know 0x0 mean a NULL pointer, right?. So why it pass the
> > attached test? In this case the application compiled with gec don't
> > crash, But have some crashes with some eiffel-iup examples. What is
> > wrong here? I misunderstood something about Void at Eiffel? I didn't ra=
n
> > a test on Liberty Eiffel, since I don't have problems with it. Any
> > advice? Thanks in advance.
> >
> > Germ=C3=A1n
>
>=20
--------------DC01133F6B827A3A6A6C2175
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<head>
<style type=3D"text/css">
<!--
/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}
div.photo-title=20
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;=20
}
div.attach-table div.attach-row {
clear: both;
}
div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}
p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}
div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}
div.attach-table div.attach-row div div span {
font-weight: normal;
}
div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8=
">
</head>
<body>
<!-- |**|begin egp html banner|**| -->
<br><br>
<!-- |**|end egp html banner|**| -->
<p>Thanks Eric. The problem was that <span class=3D"tlid-translation
translation" lang=3D"en"><span title=3D"">I stupidly replace this
(using Liberty Eiffel):</span></span></p>
<p><span class=3D"tlid-translation translation" lang=3D"en"><span
title=3D"">=C2=A0=C2=A0=C2=A0 if p.is_not_null then</span></span>=
</p>
<p><span class=3D"tlid-translation translation" lang=3D"en"><span
title=3D"">whit <br>
</span></span></p>
<p><span class=3D"tlid-translation translation" lang=3D"en"><span
title=3D"">=C2=A0=C2=A0=C2=A0 if p /=3D Void then</span></span></=
p>
<p><span class=3D"tlid-translation translation" lang=3D"en"><span
title=3D"">or with:</span></span></p>
<p><span class=3D"tlid-translation translation" lang=3D"en"><span
title=3D"">=C2=A0=C2=A0=C2=A0 if attached ....</span></span></p>
<p><span class=3D"tlid-translation translation" lang=3D"en"><span
title=3D"">which of course are not equivalent. </span></span><spa=
n
class=3D"tlid-translation translation" lang=3D"en"><span title=3D""=
><span
class=3D"tlid-translation translation" lang=3D"en"><span
title=3D"" class=3D""><br>
</span></span></span></span></p>
<p><span class=3D"tlid-translation translation" lang=3D"en"><span
title=3D""><span class=3D"tlid-translation translation" lang=3D"e=
n"><span
title=3D"" class=3D"">Now all the examples run without
problem. </span></span></span></span><span
class=3D"tlid-translation translation" lang=3D"en"><span title=3D""=
><span
class=3D"tlid-translation translation" lang=3D"en"><span
title=3D"" class=3D""><span class=3D"tlid-translation
translation" lang=3D"en"><span title=3D"" class=3D"">But I
still have to update the tutorial.</span></span></span></=
span></span></span></p>
<p><span class=3D"tlid-translation translation" lang=3D"en"><span
title=3D"">Thanks.</span></span></p>
<p><span class=3D"tlid-translation translation" lang=3D"en"><span
title=3D"">Germ=C3=A1n.<br>
</span></span></p>
<p><span class=3D"tlid-translation translation" lang=3D"en"><span
title=3D""><br>
</span></span></p>
<div class=3D"moz-cite-prefix">On 11/8/19 2:07 PM, Eric Bezault
<a class=3D"moz-txt-link-abbreviated" href=3D"mailto:[email protected]=
om">ericb-D6Qt/9opevxWk0Htik3J/[email protected]</a> [gobo-eiffel] wrote:<br>
</div>
<blockquote type=3D"cite"
cite=3D"mid:6533522a-c00e-d628-9fea-4f6b07abc939-D6Qt/9opevxWk0Htik3J/[email protected]">
<meta http-equiv=3D"content-type" content=3D"text/html; charset=3DUTF=
-8">
<span style=3D"display:none">=C2=A0</span>
=20=20=20=20=20=20
<div id=3D"ygrp-text">
<p>Hi Germ=C3=A0n,<br>
<br>
Without seeing your code, it's hard to say, but I would
suspect<br>
that when you write:<br>
<br>
if attached get_string as p then<br>
<br>
`get_string` is of type POINTER. If so, then you should
know that<br>
POINTER is an expanded class, and therefore can never be
void.<br>
So `attached get_string` will always return True. It's as
if you<br>
write:<br>
<br>
get_string /=3D Void<br>
<br>
It's not different from:<br>
<br>
int :=3D 0<br>
if attached int as i then<br>
<br>
This will always return True because an INTEGER is never
Void.<br>
In case of INTEGER, we have:<br>
<br>
attached int -> True<br>
int /=3D Void -> True<br>
int /=3D 0 -> False<br>
<br>
In case of POINTER we have:<br>
<br>
attached get_string -> True<br>
get_string /=3D Void -> True<br>
get_string /=3D default_pointer -> False<br>
get_string.is_default_pointer -> True<br>
<br>
-- <br>
Eric Bezault<br>
<a class=3D"moz-txt-link-freetext" href=3D"mailto:ericb@gobos=
oft.com">mailto:ericb-D6Qt/9opevxWk0Htik3J/[email protected]</a><br>
<a class=3D"moz-txt-link-freetext" href=3D"http://www.gobosof=
t.com">http://www.gobosoft.com</a><br>
<br>
On 08/11/2019 20:36, Germ=C3=A1n Arias <a class=3D"moz-txt-li=
nk-abbreviated" href=3D"mailto:[email protected]">[email protected]</a>
[gobo-eiffel] wrote:<br>
> Hi,<br>
> <br>
> Attached is a simple Void test. As you can see the c
function return a<br>
> char that is not attached. However it pass the test
"attached get_string<br>
> as p then". With gec it compiles and run without
problem. The output is:<br>
> <br>
> [german@localhost void-test]$ ./void_test<br>
> p is attached.<br>
> 0x402482<br>
> UH=EF=BF=BD=EF=BF=BDH=EF=BF=BDE=EF=BF=BD]=EF=BF=BDUH=EF=
=BF=BD=EF=BF=BDH=EF=BF=BD=EF=BF=BD =EF=BF=BD=EF=BF=BD=EF=BF=BDE=EF=BF=BD<br=
>
> <br>
> With ISE (C inline is different but is the same C
function) it compiles<br>
> but crash at run time. The output is:<br>
> <br>
> [german@localhost void-test]$ ./void_test<br>
> p is attached.<br>
> 0x0<br>
> <br>
> void_test: system execution failed.<br>
> Following is the set of recorded exceptions:<br>
> <br>
> ******************************** Thread exception<br>
> *****************************<br>
> In thread=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 Root thread=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 0x0
(thread id)<br>
>
***************************************************************************=
****<br>
>
----------------------------------------------------------<br=
>
> Class / Object=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Routine=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 Nature of
exception<br>
> Effect<br>
>
----------------------------------------------------------<br=
>
> VOID_TEST=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 root's creation=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
Segmentation fault:<br>
> <00007F574488E558>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
Operating system signal.<br>
> Exit<br>
>
----------------------------------------------------------<br=
>
> VOID_TEST=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 root's creation<br>
> <00007F574488E558>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
Routine failure.<br>
> Exit<br>
>
----------------------------------------------------------<br=
>
> <br>
> As far as I know 0x0 mean a NULL pointer, right?. So
why it pass the<br>
> attached test? In this case the application compiled
with gec don't<br>
> crash, But have some crashes with some eiffel-iup
examples. What is<br>
> wrong here? I misunderstood something about Void at
Eiffel? I didn't ran<br>
> a test on Liberty Eiffel, since I don't have problems
with it. Any<br>
> advice? Thanks in advance.<br>
> <br>
> Germ=C3=A1n<br>
</p>
</div>
=20=20=20=20=20=20=20=20=20=20
<style type=3D"text/css">
<!--
#ygrp-mkp {
border: 1px solid #d8d8d8;
font-family: Arial;
margin: 10px 0;
padding: 0 10px;
}
#ygrp-mkp hr {
border: 1px solid #d8d8d8;
}
#ygrp-mkp #hd {
color: #628c2a;
font-size: 85%;
font-weight: 700;
line-height: 122%;
margin: 10px 0;
}
#ygrp-mkp #ads {
margin-bottom: 10px;
}
#ygrp-mkp .ad {
padding: 0 0;
}
#ygrp-mkp .ad p {
margin: 0;
}
#ygrp-mkp .ad a {
color: #0000ff;
text-decoration: none;
}
#ygrp-sponsor #ygrp-lc {
font-family: Arial;
}
#ygrp-sponsor #ygrp-lc #hd {
margin: 10px 0px;
font-weight: 700;
font-size: 78%;
line-height: 122%;
}
#ygrp-sponsor #ygrp-lc .ad {
margin-bottom: 10px;
padding: 0 0;
}
#actions {
font-family: Verdana;
font-size: 11px;
padding: 10px 0;
}
#activity {
background-color: #e0ecee;
float: left;
font-family: Verdana;
font-size: 10px;
padding: 10px;
}
#activity span {
font-weight: 700;
}
#activity span:first-child {
text-transform: uppercase;
}
#activity span a {
color: #5085b6;
text-decoration: none;
}
#activity span span {
color: #ff7900;
}
#activity span .underline {
text-decoration: underline;
}
.attach {
clear: both;
display: table;
font-family: Arial;
font-size: 12px;
padding: 10px 0;
width: 400px;
}
.attach div a {
text-decoration: none;
}
.attach img {
border: none;
padding-right: 5px;
}
.attach label {
display: block;
margin-bottom: 5px;
}
.attach label a {
text-decoration: none;
}
blockquote {
margin: 0 0 0 4px;
}
.bold {
font-family: Arial;
font-size: 13px;
font-weight: 700;
}
.bold a {
text-decoration: none;
}
dd.last p a {
font-family: Verdana;
font-weight: 700;
}
dd.last p span {
margin-right: 10px;
font-family: Verdana;
font-weight: 700;
}
dd.last p span.yshortcuts {
margin-right: 0;
}
div.attach-table div div a {
text-decoration: none;
}
div.attach-table {
width: 400px;
}
div.file-title a, div.file-title a:active, div.file-title a:hover, div.fi=
le-title a:visited {
text-decoration: none;
}
div.photo-title a, div.photo-title a:active, div.photo-title a:hover, div=
...photo-title a:visited {
text-decoration: none;
}
div#ygrp-mlmsg #ygrp-msg p a span.yshortcuts {
font-family: Verdana;
font-size: 10px;
font-weight: normal;
}
.green {
color: #628c2a;
}
.MsoNormal {
margin: 0 0 0 0;
}
o {
font-size: 0;
}
#photos div {
float: left;
width: 72px;
}
#photos div div {
border: 1px solid #666666;
height: 62px;
overflow: hidden;
width: 62px;
}
#photos div label {
color: #666666;
font-size: 10px;
overflow: hidden;
text-align: center;
white-space: nowrap;
width: 64px;
}
#reco-category {
font-size: 77%;
}
#reco-desc {
font-size: 77%;
}
.replbq {
margin: 4px;
}
#ygrp-actbar div a:first-child {
/* border-right: 0px solid #000;*/
margin-right: 2px;
padding-right: 5px;
}
#ygrp-mlmsg {
font-size: 13px;
font-family: Arial, helvetica,clean, sans-serif;
*font-size: small;
*font: x-small;
}
#ygrp-mlmsg table {
font-size: inherit;
font: 100%;
}
#ygrp-mlmsg select, input, textarea {
font: 99% Arial, Helvetica, clean, sans-serif;
}
#ygrp-mlmsg pre, code {
font:115% monospace;
*font-size:100%;
}
#ygrp-mlmsg * {
line-height: 1.22em;
}
#ygrp-mlmsg #logo {
padding-bottom: 10px;
}
#ygrp-msg p a {
font-family: Verdana;
}
#ygrp-msg p#attach-count span {
color: #1E66AE;
font-weight: 700;
}
#ygrp-reco #reco-head {
color: #ff7900;
font-weight: 700;
}
#ygrp-reco {
margin-bottom: 20px;
padding: 0px;
}
#ygrp-sponsor #ov li a {
font-size: 130%;
text-decoration: none;
}
#ygrp-sponsor #ov li {
font-size: 77%;
list-style-type: square;
padding: 6px 0;
}
#ygrp-sponsor #ov ul {
margin: 0;
padding: 0 0 0 8px;
}
#ygrp-text {
font-family: Georgia;
}
#ygrp-text p {
margin: 0 0 1em 0;
}
#ygrp-text tt {
font-size: 120%;
}
#ygrp-vital ul li:last-child {
border-right: none !important;
}
-->
</style>
=20=20=20=20=20=20
=20=20=20=20=20=20
<!-- end group email -->
</blockquote>
=20=20
<!-- |**|begin egp html banner|**| -->
<br>
<br>
<!-- |**|end egp html banner|**| -->
<div width=3D"1" style=3D"color: white; clear: both;"/>__._,_.___</div>
=20=20=20=20=20=20
=20=20
=20=20=20=20
<div id=3D"fromDMARC" style=3D"clear:both; margin-top: 10px;">
<hr style=3D"height:2px ; border-width:0; color:#E3E3E3; backgroun=
d-color:#E3E3E3;">
Posted by: =3D?UTF-8?Q?Germ=3Dc3=3Da1n_Arias?=3D <germanandre@g=
mx.es> <hr style=3D"height:2px ; border-width:0; color:#E3E3E3; =
background-color:#E3E3E3;">
</div>
<!-- Start Recommendations -->
<!-- End Recommendations -->
<!-- |**|begin egp html banner|**| -->
<br><br>
<tt>
To Post a message, send it to: [email protected]<BR>
To Unsubscribe, send a blank message to: gobo-eiffel-unsubscribe-B11MqFFcr06IwRZHo2/[email protected]=
m</tt>
<br><br>
<!-- |**|end egp html banner|**| -->
<!-- |**|begin egp html banner|**| -->
<img src=3D"http://geo.yahoo.com/serv?s=3D97476590/grpId=3D1522270/grpspI=
d=3D1705006764/msgId=3D1889/stime=3D1573276226" width=3D"1" height=3D"1"> <=
br>
<!-- |**|end egp html banner|**| -->
=20=20=20=20
<!-- |**|begin egp html banner|**| -->
<br>
=20=20=20
=20=20=20=20=20
=20
<!-- |**|begin egp html banner|**| -->
<div id=3D"ygrp-vital" style=3D"background-color: #f2f2f2; font-fam=
ily: Verdana; font-size: 10px; margin-bottom: 10px; padding: 10px;">
<span id=3D"vithd" style=3D"font-weight: bold; color: #333; text-tr=
ansform: uppercase; "><a href=3D"https://groups.yahoo.com/neo/groups/gobo-e=
iffel/info;_ylc=3DX3oDMTJlOTM2OGsyBF9TAzk3MzU5NzE0BGdycElkAzE1MjIyNzAEZ3Jwc=
3BJZAMxNzA1MDA2NzY0BHNlYwN2dGwEc2xrA3ZnaHAEc3RpbWUDMTU3MzI3NjIyNg--" style=
=3D"text-decoration: none;">Visit Your Group</a></span>
<ul style=3D"list-style-type: none; margin: 0; padding: 0; display: in=
line;">
</ul>
</div>
<div id=3D"ft" style=3D"font-family: Arial; font-size: 11px; margin-top: 5p=
x; padding: 0 2px 0 0; clear: both;">
<a href=3D"https://groups.yahoo.com/neo;_ylc=3DX3oDMTJkcmxyM2t2BF9TAzk3ND=
c2NTkwBGdycElkAzE1MjIyNzAEZ3Jwc3BJZAMxNzA1MDA2NzY0BHNlYwNmdHIEc2xrA2dmcARzd=
GltZQMxNTczMjc2MjI2" style=3D"float: left;"><img src=3D"https://s.yimg.com/=
ru/0.9.12/min/css/yahoo_en-US_f_pw_101x21.png" height=3D"21" width=3D"101" =
alt=3D"Yahoo! Groups" style=3D"border: 0;"/></a>
<div style=3D"color: #747575; float: right;"> • <a href=3D"https://i=
nfo.yahoo.com/privacy/us/yahoo/groups/details.html" style=3D"text-decoratio=
n: none;">Privacy</a> • <a href=3D"mailto:gobo-eiffel-unsubscribe@yaho=
ogroups.com?subject=3DUnsubscribe" style=3D"text-decoration: none;">Unsubsc=
ribe</a> • <a href=3D"https://info.yahoo.com/legal/us/yahoo/utos/terms=
/" style=3D"text-decoration: none;">Terms of Use</a> </div>
</div>
<!-- |**|end egp html banner|**| -->
</div> <!-- ygrp-msg -->
=20=20=20
<br>
<!-- |**|end egp html banner|**| -->
<div style=3D"color: white; clear: both;"/>__,_._,___</div>
</body>
</html>
--------------DC01133F6B827A3A6A6C2175--