From 3c7684f7983c4ef4f6d8066ff11a80445a739f9b Mon Sep 17 00:00:00 2001 From: guenther <> Date: Sat, 24 Jul 2010 22:17:03 +0000 Subject: [PATCH] Teach lint about C99's _Bool and _Complex, plus some related gcc extensions: __real__ and __imag__ operators, the use of '~' for complex conjugation, and 'i' or 'j' as a suffix for complex constants. While this doesn't handle folding and overflow detection for complex constants correctly, it's good enough to make it through libm...and found several bugs once it could do so. "no objections" miod@, krw@ --- src/include/complex.h | 4 +++- src/include/stdbool.h | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/include/complex.h b/src/include/complex.h index aa89d700..be85c7c0 100644 --- a/src/include/complex.h +++ b/src/include/complex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: complex.h,v 1.2 2008/12/04 03:52:31 ray Exp $ */ +/* $OpenBSD: complex.h,v 1.3 2010/07/24 22:17:03 guenther Exp $ */ /* * Copyright (c) 2008 Martynas Venckus * @@ -28,6 +28,8 @@ #define _Complex __complex__ #endif #define _Complex_I 1.0fi +#elif defined(lint) +#define _Complex_I 1.0fi #endif #define complex _Complex diff --git a/src/include/stdbool.h b/src/include/stdbool.h index cc1104c6..34304130 100644 --- a/src/include/stdbool.h +++ b/src/include/stdbool.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdbool.h,v 1.4 2007/10/02 14:06:16 otto Exp $ */ +/* $OpenBSD: stdbool.h,v 1.5 2010/07/24 22:17:03 guenther Exp $ */ /* * Written by Marc Espie, September 25, 1999 @@ -10,7 +10,7 @@ #ifndef __cplusplus -#if (defined(__GNUC__) && __GNUC__ >= 3) || defined(__PCC__) +#if (defined(__GNUC__) && __GNUC__ >= 3) || defined(__PCC__) || defined(lint) /* Support for _C99: type _Bool is already built-in. */ #define false 0 #define true 1