From: Francesco Chemolli Date: Thu, 17 Feb 2011 15:40:21 +0000 (+0100) Subject: Portability fix: override compiler magic in understanding when a function is really... X-Git-Tag: take03^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d431d0edd9fa13d51032d8615820ce451c49d571;p=thirdparty%2Fsquid.git Portability fix: override compiler magic in understanding when a function is really unused. --- diff --git a/src/base/TextException.h b/src/base/TextException.h index 89f5168091..bbad80387a 100644 --- a/src/base/TextException.h +++ b/src/base/TextException.h @@ -5,6 +5,9 @@ #include +#if __GNUC__ +__attribute__((unused)) +#endif static unsigned int FileNameHashCached(const char *fname); // simple exception to report custom errors @@ -60,12 +63,6 @@ FileNameHashCached(const char *fname) return lastHash; } -/// Avoids "defined but not used" warnings for FileNameHashCached -class FileNameHashCacheUser -{ - bool use(void *ptr=NULL) { return ptr != &FileNameHashCached;} -}; - #if !defined(TexcHere) # define TexcHere(msg) TextException((msg), __FILE__, __LINE__, \ (FileNameHashCached(__FILE__)<<14) | (__LINE__ & 0x3FFF))