[Spread-users] Small portability issue in alarm.c

andreas.ames at de.transport.bombardier.com andreas.ames at de.transport.bombardier.com
Mon Oct 29 10:26:56 EDT 2012


Hi all,

I've compiled spread 4.2 with gcc version egcs-2.91.66 19990314/Linux 
(egcs-1.1.2 release) on Redhat 6.1, i.e. glibc 2.1.2 (no, this is not a 
typo ;-).  It compiled just fine with a minor issue concerning the use of 
va_copy in alarm.c.  Googling around a bit I found the following approach 
which should be better portable than just using "va_copy" (according to 
the glibc reference manual and the autoconf manual) and certainly compiles 
on my platform:

--- alarm.c.orig        Mon Oct 29 13:40:12 2012
+++ alarm.c     Mon Oct 29 13:55:38 2012
@@ -191,7 +191,11 @@
            }
         }
 
-        va_copy(ap_copy, ap);                               /* make a 
copy of param list in case of vsnprintf truncation */
+#ifdef __va_copy                                            /* make a 
copy of param list in case of vsnprintf truncation */
+        __va_copy(ap_copy, ap);
+#else
+        memcpy(&ap_copy, &ap, sizeof (va_list));
+#endif
         msg_len  = vsnprintf(msg_ptr, MAX_ALARM_MESSAGE_BUF - tot_len, 
message, ap);
         tot_len += msg_len;
 

cheers,

aa

--
 
  
Please consider the environment before you print / Merci de penser à 
l'environnement avant d'imprimer / Bitte denken Sie an die Umwelt bevor 
Sie drucken 

Bombardier Transportation GmbH 
Vorsitzender des Aufsichtsrats / Chairman of Supervisory Board: Prof. Dr. 
Wilhelm Bender 
Geschäftsführung / Executive Board: Michael Clausecker 
(Vorsitzender/Chairman), Dr. Susanne Kortendick, Luc Charlemagne, 
Gregorius Peters 
Sitz der Gesellschaft / Principal Office: Berlin 
Registergericht / Registration Court: Amtsgericht Charlottenburg, HRB 
64838 

_______________________________________________________________________________________________________________ 

This e-mail communication (and any attachment/s) may contain confidential 
or privileged information and is intended only for the individual(s) or 
entity named above and to others who have been specifically authorized to 
receive it. If you are not the intended recipient, please do not read, 
copy, use or disclose the contents of this communication to others. Please 
notify the sender that you have received this e-mail in error by reply 
e-mail, and delete the e-mail subsequently. Please note that in order to 
protect the security of our information systems an AntiSPAM solution is in 
use and will browse through incoming emails. 
Thank you. 
_________________________________________________________________________________________________________________ 


Ce message (ainsi que le(s) fichier(s)), transmis par courriel, peut 
contenir des renseignements confidentiels ou protégés et est destiné à 
l?usage exclusif du destinataire ci-dessus. Toute autre personne est, par 
les présentes, avisée qu?il est strictement interdit de le diffuser, le 
distribuer ou le reproduire. Si vous l?avez reçu par inadvertance, 
veuillez nous en aviser et détruire ce message. Veuillez prendre note 
qu'une solution antipollupostage (AntiSPAM) est utilisée afin d'assurer la 
sécurité de nos systèmes d'information et qu'elle furètera les courriels 
entrants.
Merci. 
_________________________________________________________________________________________________________________ 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.spread.org/pipermail/spread-users/attachments/20121029/e2292596/attachment.html 


More information about the Spread-users mailing list