Thanks to Jean-Pierre Kuypers on fr.*, the problem is known but the
author of the patch says that he doesn't find where to submit it: https://trac.macports.org/ticket/61662
I believe they should use instead the following portable code from rra-c-util:
/*
* 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
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.
Once in src/snprintf.c, where there is:
/* 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.
#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?
Once in src/snprintf.c, where there is:
/* 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.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 286 |
Nodes: | 16 (2 / 14) |
Uptime: | 82:53:06 |
Calls: | 6,495 |
Calls today: | 6 |
Files: | 12,096 |
Messages: | 5,276,825 |