diff options
author | Richard Stallman <rms@gnu.org> | 1993-02-05 23:00:46 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-02-05 23:00:46 +0000 |
commit | 53b01f59f941e17aeece1e1e35347e00e2e62842 (patch) | |
tree | ee98342fa4402fb20052c90f531ae93a10502b73 | |
parent | ed3eea740ab2b5bd088dc1cc63b0261a2249c12e (diff) | |
download | gcc-53b01f59f941e17aeece1e1e35347e00e2e62842.zip gcc-53b01f59f941e17aeece1e1e35347e00e2e62842.tar.gz gcc-53b01f59f941e17aeece1e1e35347e00e2e62842.tar.bz2 |
(build_c_cast): Bypass default_conversion when casting to void.
From-SVN: r3423
-rw-r--r-- | gcc/c-typeck.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 3cb6959..7bbad14 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3756,6 +3756,12 @@ build_c_cast (type, expr) else { tree otype; + + /* If casting to void, avoid the error that would come + from default_conversion in the case of a non-lvalue array. */ + if (type == void_type_node) + return build1 (CONVERT_EXPR, type, value); + /* Convert functions and arrays to pointers, but don't convert any other types. */ if (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE |