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 --- tools/ivyprobe.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'tools/ivyprobe.c') 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 } -- cgit v1.1