From 57d09c10f714721487472a28063aeade3fd51d2f Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 21 Jun 2007 15:42:06 +0000 Subject: [PATCH] Avoid some compiler warnings that come up ''every day'' in MTT (and have been for eons): make a symbol be used in a dumb but harmless way. This commit was SVN r15158. --- ompi/mca/btl/openib/btl_openib_lex.l | 9 +++++++++ opal/util/keyval/keyval_lex.l | 9 +++++++++ opal/util/show_help_lex.l | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/ompi/mca/btl/openib/btl_openib_lex.l b/ompi/mca/btl/openib/btl_openib_lex.l index cc38b40fd3..af58b45a73 100644 --- a/ompi/mca/btl/openib/btl_openib_lex.l +++ b/ompi/mca/btl/openib/btl_openib_lex.l @@ -113,6 +113,15 @@ static int finish_parsing(void) YY_CURRENT_BUFFER = NULL; #endif /* YY_CURRENT_BUFFER_LVALUE */ } + + /* Put in this dumb thing to avoid a compiler warning about + yy_flex_realloc being defined but not used. @#$@!#$!@#$ */ + { + char *foo = malloc(1); + foo = yy_flex_realloc(foo, 2); + free(foo); + } + return YY_NULL; } diff --git a/opal/util/keyval/keyval_lex.l b/opal/util/keyval/keyval_lex.l index 0bedabe59a..8069f2c1f5 100644 --- a/opal/util/keyval/keyval_lex.l +++ b/opal/util/keyval/keyval_lex.l @@ -97,6 +97,15 @@ static int finish_parsing(void) YY_CURRENT_BUFFER = NULL; #endif /* YY_CURRENT_BUFFER_LVALUE */ } + + /* Put in this dumb thing to avoid a compiler warning about + yy_flex_realloc being defined but not used. @#$@!#$!@#$ */ + { + char *foo = malloc(1); + foo = yy_flex_realloc(foo, 2); + free(foo); + } + return YY_NULL; } diff --git a/opal/util/show_help_lex.l b/opal/util/show_help_lex.l index 49a7d69f48..9ee12d9718 100644 --- a/opal/util/show_help_lex.l +++ b/opal/util/show_help_lex.l @@ -88,6 +88,15 @@ int opal_show_help_finish_parsing(void) YY_CURRENT_BUFFER = NULL; #endif /* YY_CURRENT_BUFFER_LVALUE */ } + + /* Put in this dumb thing to avoid a compiler warning about + yy_flex_realloc being defined but not used. @#$@!#$!@#$ */ + { + char *foo = malloc(1); + foo = yy_flex_realloc(foo, 2); + free(foo); + } + return YY_NULL; }