Browse Source

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@
OPENBSD_4_8
guenther 14 years ago
parent
commit
3c7684f798
2 changed files with 5 additions and 3 deletions
  1. +3
    -1
      src/include/complex.h
  2. +2
    -2
      src/include/stdbool.h

+ 3
- 1
src/include/complex.h View File

@ -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 <martynas@openbsd.org> * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
* *
@ -28,6 +28,8 @@
#define _Complex __complex__ #define _Complex __complex__
#endif #endif
#define _Complex_I 1.0fi #define _Complex_I 1.0fi
#elif defined(lint)
#define _Complex_I 1.0fi
#endif #endif
#define complex _Complex #define complex _Complex


+ 2
- 2
src/include/stdbool.h View File

@ -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 * Written by Marc Espie, September 25, 1999
@ -10,7 +10,7 @@
#ifndef __cplusplus #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. */ /* Support for _C99: type _Bool is already built-in. */
#define false 0 #define false 0
#define true 1 #define true 1


Loading…
Cancel
Save