Discussion:
SLRN build fail on macOS
(too old to reply)
Julien ÉLIE
2021-02-13 09:32:56 UTC
Permalink
Also crossposting to the most appropriate newsgroup (news.software.readers).
The original question is: where to submit patches for slrn? Is
development still active? (it seems that there had been 3 commits in
January by John E. Davis after 4 years without any commit at all)

There's an improvement to add to the VA_COPY portability code.
slrn's autoconf/configure.ac file uses code taken from very old glib
1.2.8 (according to a comment). Nowadays, va_copy could just be defined as:

/*
* C99 requires va_copy. Older versions of GCC provide __va_copy. Per the
* Autoconf manual, memcpy is a generally portable fallback.
*/
#ifndef va_copy
# ifdef __va_copy
# define va_copy(d, s) __va_copy((d), (s))
# else
# define va_copy(d, s) memcpy(&(d), &(s), sizeof(va_list))
# endif
#endif
--
Julien
Bonjour Gérald,
#ifndef va_copy
#    ifdef __va_copy
#        define va_copy(d, s) __va_copy((d), (s))
#    else
#        define va_copy(d, s) memcpy(&(d), &(s), sizeof(va_list))
#    endif
#endif
As I said, it's beyond my skills or knowledge.
What is the file to patch with this?
Anything else to modify?
I see that VA_COPY is only used twice in srln source code.
/* Define VA_COPY() to do the right thing for copying va_list variables.
 * config.h may have already defined VA_COPY as va_copy or __va_copy.
 */
#ifndef VA_COPY
# if (defined (__GNUC__) && defined (__PPC__) && (defined (_CALL_SYSV)
|| defined (__WIN32__))) || defined (__WATCOMC__)
#  define VA_COPY(ap1, ap2)   (*(ap1) = *(ap2))
# elif defined (VA_COPY_AS_ARRAY)
#  define VA_COPY(ap1, ap2)   memmove ((ap1), (ap2), sizeof (va_list))
# else /* va_list is a pointer */
#  define VA_COPY(ap1, ap2)   ((ap1) = (ap2))
# endif /* va_list is a pointer */
#endif /* !VA_COPY */
And another time in src/misc.c where that piece of code is not present.
Well, to be straight-forward (though not optimal because with a
duplication), just add the same lines as above at the beginning of
src/misc.c.
I believe it will solve the problem.
Gérald Niel
2021-02-13 12:23:53 UTC
Permalink
[Followup-To: news.software.readers]

Le Samedi 13 février 2021 à 09:24 UTC, Julien ÉLIE écrivait sur
/* Define VA_COPY() to do the right thing for copying va_list variables.
* config.h may have already defined VA_COPY as va_copy or __va_copy.
*/
#ifndef VA_COPY
# if (defined (__GNUC__) && defined (__PPC__) && (defined (_CALL_SYSV)
|| defined (__WIN32__))) || defined (__WATCOMC__)
# define VA_COPY(ap1, ap2) (*(ap1) = *(ap2))
# elif defined (VA_COPY_AS_ARRAY)
# define VA_COPY(ap1, ap2) memmove ((ap1), (ap2), sizeof (va_list))
# else /* va_list is a pointer */
# define VA_COPY(ap1, ap2) ((ap1) = (ap2))
# endif /* va_list is a pointer */
#endif /* !VA_COPY */
And another time in src/misc.c where that piece of code is not present.
Well, to be straight-forward (though not optimal because with a
duplication), just add the same lines as above at the beginning of
src/misc.c.
I believe it will solve the problem.
Thanks, it works.

I will be able to test the patch for the libcanlock v3.

@+
--
On ne le dira jamais assez, l'anarchisme, c'est l'ordre sans le
gouvernement ; c'est la paix sans la violence. C'est le contraire
précisément de tout ce qu'on lui reproche, soit par ignorance, soit
par mauvaise foi. -+- Hem Day -+-
Michael Bäuerle
2021-02-14 17:15:43 UTC
Permalink
Post by Gérald Niel
/* Define VA_COPY() to do the right thing for copying va_list variables.
* config.h may have already defined VA_COPY as va_copy or __va_copy.
*/
#ifndef VA_COPY
# if (defined (__GNUC__) && defined (__PPC__) && (defined (_CALL_SYSV)
|| defined (__WIN32__))) || defined (__WATCOMC__)
# define VA_COPY(ap1, ap2) (*(ap1) = *(ap2))
# elif defined (VA_COPY_AS_ARRAY)
# define VA_COPY(ap1, ap2) memmove ((ap1), (ap2), sizeof (va_list))
# else /* va_list is a pointer */
# define VA_COPY(ap1, ap2) ((ap1) = (ap2))
# endif /* va_list is a pointer */
#endif /* !VA_COPY */
And another time in src/misc.c where that piece of code is not present.
Well, to be straight-forward (though not optimal because with a
duplication), just add the same lines as above at the beginning of
src/misc.c.
I believe it will solve the problem.
Thanks, it works.
I will be able to test the patch for the libcanlock v3.
I have uploaded a new patchset (matching for the slrn 1.0.4-5 snapshot)
to the libcanlock homepage:
<https://micha.freeshell.org/libcanlock/index.html#patches>
Gérald Niel
2021-02-14 20:24:57 UTC
Permalink
Le Dimanche 14 février 2021 à 17:15 UTC, Michael Bäuerle écrivait sur
Post by Michael Bäuerle
Post by Gérald Niel
I will be able to test the patch for the libcanlock v3.
I have uploaded a new patchset (matching for the slrn 1.0.4-5 snapshot)
<https://micha.freeshell.org/libcanlock/index.html#patches>
Doesn't woks:

slrn-pre1.0.4-5/src/misc.c:376:4: error: implicit declaration of
function 'VA_COPY' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
VA_COPY(ap1, ap);
^
1 error generated.

But with the Julien's solution, it works.

@+
--
On ne le dira jamais assez, l'anarchisme, c'est l'ordre sans le
gouvernement ; c'est la paix sans la violence. C'est le contraire
précisément de tout ce qu'on lui reproche, soit par ignorance, soit
par mauvaise foi. -+- Hem Day -+-
Michael Bäuerle
2021-02-15 09:23:44 UTC
Permalink
Post by Gérald Niel
Post by Michael Bäuerle
Post by Gérald Niel
I will be able to test the patch for the libcanlock v3.
I have uploaded a new patchset (matching for the slrn 1.0.4-5 snapshot)
<https://micha.freeshell.org/libcanlock/index.html#patches>
slrn-pre1.0.4-5/src/misc.c:376:4: error: implicit declaration of
function 'VA_COPY' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
VA_COPY(ap1, ap);
^
1 error generated.
But with the Julien's solution, it works.
I have only refactored the existing Cancel-Lock patches so that they
apply cleanly again (to the snapshot 1.0.4-5).

The VA_COPY patch from Julien is unrelated to Cancel-Lock and should
be packaged separately (IMHO).
Gérald Niel
2021-02-15 11:56:08 UTC
Permalink
Le Lundi 15 février 2021 à 09:23 UTC, Michael Bäuerle écrivait sur
Post by Michael Bäuerle
I have only refactored the existing Cancel-Lock patches so that they
apply cleanly again (to the snapshot 1.0.4-5).
The VA_COPY patch from Julien is unrelated to Cancel-Lock and should
be packaged separately (IMHO).
OK, so it works. ;)
I'm posting with a patched slrn.

First Cancel-Lock/Key added client side with slrn/libcanlock (on macOS
Big Sur), second server side with the scripts (nnrpd_filter.pl)
adapted to use sha-256 alog.


@+
--
On ne le dira jamais assez, l'anarchisme, c'est l'ordre sans le
gouvernement ; c'est la paix sans la violence. C'est le contraire
précisément de tout ce qu'on lui reproche, soit par ignorance, soit
par mauvaise foi. -+- Hem Day -+-
Paul Walker
2021-02-16 14:44:51 UTC
Permalink
Post by Julien ÉLIE
Also crossposting to the most appropriate newsgroup (news.software.readers).
The original question is: where to submit patches for slrn? Is
development still active? (it seems that there had been 3 commits in
January by John E. Davis after 4 years without any commit at all)
If you get an answer I'd like to know. :-) I've posted to slrn-user (and
direct to JED) but without any reply yet.

Just FYI, I've got a clone of the slrn repo at https://github.com/arafel/slrn/

I haven't done much with it yet. I'm thinking of keeping a branch to track
upstream (if there are any changes) and actually merging changes into the
master/main - at least that way there's somewhere with updated changes.

Do you want to (or do you want me to) add your VA_COPY code to the repo?

Thanks
--
Paul
Julien ÉLIE
2021-02-16 21:26:02 UTC
Permalink
Hi Paul,
Post by Paul Walker
Just FYI, I've got a clone of the slrn repo at https://github.com/arafel/slrn/
I haven't done much with it yet. I'm thinking of keeping a branch to track
upstream (if there are any changes) and actually merging changes into the
master/main - at least that way there's somewhere with updated changes.
That's a great initiative, thanks!
Post by Paul Walker
Do you want to (or do you want me to) add your VA_COPY code to the repo?
Please do if you want, either by just adding missing code in src/misc.c
(straight-forward, but which duplicates code) or much cleaner by fixing
the detection code in autoconf/configure.ac (which lacks inclusions of
<stdlib.h> as shown in a patch at
<https://trac.macports.org/ticket/61662>) and then regenerate the
configure script.
--
Julien ÉLIE

« Les amis de la vérité sont ceux qui la cherchent, et non ceux qui se
vantent de l'avoir trouvée. » (Condorcet)
Paul Walker
2021-02-19 10:33:26 UTC
Permalink
Post by Julien ÉLIE
Post by Paul Walker
Do you want to (or do you want me to) add your VA_COPY code to the repo?
Please do if you want, either by just adding missing code in src/misc.c
(straight-forward, but which duplicates code) or much cleaner by fixing
I'm afraid I don't speak autoconf (yet?); I've sent you an email.

Thanks
--
Paul
Loading...