From 3bba51658b025ee6075eb9ebfe0ee32ee8b2c750 Mon Sep 17 00:00:00 2001 From: bustico Date: Mon, 25 Nov 2013 10:43:04 +0000 Subject: ° protect gcc pragma not available on old version of gcc ° tcl loop compiled for tcl8.4 --- debian/changelog | 5 +++++ src/Makefile | 2 +- tools/ivyprobe.c | 17 +++++++++-------- tools/ivytestready.c | 4 ++-- tools/ivythroughput.cpp | 16 ++++++++-------- 5 files changed, 25 insertions(+), 19 deletions(-) diff --git a/debian/changelog b/debian/changelog index c31cf2e..8a9569f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,8 @@ +ivy-c (3.14.3) unstable; urgency=low + + * protect some gcc pragma not available on old gcc version + + -- Alexandre Bustico Thu, 20 June 2013 18:37:00 +0200 ivy-c (3.14.2) unstable; urgency=low * initial windows support for ping/pong implementation, to be tested and validated diff --git a/src/Makefile b/src/Makefile index 98e1b8c..a2b8298 100644 --- a/src/Makefile +++ b/src/Makefile @@ -54,7 +54,7 @@ ifndef TCLVERS TCLVERS:= $(shell perl -e '@_=sort map (m|/usr/lib64/libtcl(\d\.\d)\.so|, glob ("/usr/lib64/libtcl*")); print pop @_') endif ifndef TCLVERS -TCLVERS=8.3 +TCLVERS=8.4 endif TCLINCL = -I/usr/include/tcl$(TCLVERS) diff --git a/tools/ivyprobe.c b/tools/ivyprobe.c index 6e5f3e1..8b164a1 100644 --- a/tools/ivyprobe.c +++ b/tools/ivyprobe.c @@ -171,12 +171,13 @@ void HandleStdin (Channel channel, IVY_HANDLE fd, void *data) printf("Error compiling '%s', %s, not bound\n", arg, errbuf); } else { IvyBindingFree( binding ); -#if defined(__GNUC__) + +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" #endif IvyBindMsg (Callback, NULL, arg); -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic pop #endif } @@ -242,12 +243,12 @@ void HandleStdin (Channel channel, IVY_HANDLE fd, void *data) } } else { cmd = strtok (buf, "\n"); -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" #endif err = IvySendMsg (cmd); -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic pop #endif printf("-> Sent to %d peer%s\n", err, err == 1 ? "" : "s"); @@ -354,12 +355,12 @@ void BindMsgOfFile( const char * regex_file ) if ( size > 1 ) { line[size-1] = '\0'; /* supress \n */ -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" #endif IvyBindMsg (Callback, NULL, line); -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic pop #endif } @@ -454,12 +455,12 @@ int main(int argc, char *argv[]) for (; optind < argc; optind++) { printf("Binding to '%s'\n", argv[optind] ); -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" #endif IvyBindMsg (Callback, NULL, argv[optind]); -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic pop #endif } diff --git a/tools/ivytestready.c b/tools/ivytestready.c index 35e0eae..46fe1de 100755 --- a/tools/ivytestready.c +++ b/tools/ivytestready.c @@ -104,12 +104,12 @@ int main(int argc, char *argv[]) IvyInit (me, ready_message, NULL,NULL,NULL,NULL); IvySetBindCallback( binCB, 0 ); -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" #endif IvyBindMsg (Ready, NULL, ready_bind); -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic pop #endif diff --git a/tools/ivythroughput.cpp b/tools/ivythroughput.cpp index e1734d5..68543e9 100644 --- a/tools/ivythroughput.cpp +++ b/tools/ivythroughput.cpp @@ -281,7 +281,7 @@ void emetteur (const char* bus, KindOfTest kod, int testDuration, # | | | __/ | (__ | __/ | | \ |_ | __/ | |_| | | | # |_| \___| \___| \___| |_| \__| \___| \__,_| |_| */ -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" #endif @@ -320,7 +320,7 @@ void recepteur_tp (const char* bus, KindOfTest kod, unsigned int inst, IvyStart (bus); IvyMainLoop (); } -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic pop #endif @@ -346,12 +346,12 @@ void recepteur_ml (const char* bus, KindOfTest kod, unsigned int inst, debugInt++; string reg = *iter; if (regexpAreUniq) { (reg += " ") += stream.str();} -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" #endif bindIdList.push_back (IvyBindMsg (recepteurCB, (void *) long(inst), reg.c_str())); -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic pop #endif @@ -555,12 +555,12 @@ void sendAllMessageCB (TimerId id, void *user_data, unsigned long delta) IvySendMsg ("startOfSequence"); ListOfString::iterator iter; for (iter=messages->begin(); iter != messages->end(); iter++) { -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" #endif envoyes += IvySendMsg ((*iter).c_str()); -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic pop #endif } @@ -641,13 +641,13 @@ void desabonneEtReabonneCB (TimerId id, void *user_data, unsigned long delta) ListOfString::const_iterator iter2; for (iter2=mds->regexps->begin(); iter2 != mds->regexps->end(); iter2++) { string reg = *iter2; -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" #endif mds->bindIdList->push_back (IvyBindMsg (recepteurCB, (void *) long(mds->inst), reg.c_str())); -#if defined(__GNUC__) +#if defined(__GNUC__) && __GNUC_PREREQ(4,7) #pragma GCC diagnostic pop #endif } -- cgit v1.1