On Sat, Nov 18, 2023 at 07:46:03PM +0800, Qian Yun wrote:
>
>
> On 11/18/23 19:32, Waldek Hebisch wrote:
> >
> > This really says nothing about 'extern' declarations on Lisp side.
> > And times have changed: old C had "implict int" rule governing
> > undeclared functions, but this rule for many years were considered
> > obsolete and now is gone from C standard. More important, C
> > compilers frequently are configured to reject code trying to
> > use undeclared functions.
> >
> > So, let me reiterate: extern declarations are needed. Now they
> > should be present for all calls. For calls returning 'double'
> > even with old rules call would not work (we would silently get
> > wrong code). I did not add declarations earlier, as this
> > could be done by Lisp implementation. But ECL folks do not
> > want to do this, so we add them on FriCAS side. It is likely
> > that GCL also is not adding declarations and that we need to
> > add them on our side.
>
> I can fix this in a later commit.
You mean you will keep extern declaration now and look at
the problem later? That is fine. But we should not commit
such change befor checking if it is really correct.
> > > > know why you want to move definition of 'sockSendString'?
> > > > It is closely related to 'sock_send_string_len' and keeping
> > > > them together looks clearer for me.
> > >
> > > It is enclosed in "foreign-defs", which is defined differently
> > > for CMUCL and CLISP. So for consistency, I'd like to move
> > > it out of "foreign-defs".
> >
> > 'sockSendString' can not work without 'sock_send_string_len',
> > so effectively its definition is complete only when "foreign-defs"
> > are done. And 'sockSendString' is clesely related to
> > 'sock_send_string_len'.
> > So IMO "foreign-defs" is red herring here, for consistency we
> > should keep the two functions together.
>
> Fine by me. But what about |sockGetStringFrom|? Shall it be enclosed
> inside "foreign-defs" as well?
IMO there is no need to extend "foreign-defs" to enclose
|sockGetStringFrom|. We keep definition seqentially in the file
and it should be enough for a reader to notice that definition
are related and that there is dependence.
> I'll leave this change and commit the rest.
Well, leave out the two changes.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/ZVivHbZph-MkWnIl%40fricas.org.