From 4e6f7e6d83e4d3b37e439ca4e85232df1af69008 Mon Sep 17 00:00:00 2001 From: borutr Date: Tue, 26 Feb 2008 06:24:45 +0000 Subject: [PATCH] * src/SDCCast.c, src/SDCCast.h: fixed RFE #1901171: inerger promotion of casted varargs git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5049 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 5 +++++ src/SDCCast.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ada71110..7005c0c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-26 Borut Razem + + * src/SDCCast.c, src/SDCCast.h: fixed RFE #1901171 ] inerger promotion + of casted varargs + 2008-02-25 Maarten Brock * src/mcs51/gen.c (genPagedPointerSet): fixed bug 1670148 diff --git a/src/SDCCast.c b/src/SDCCast.c index ac571b5a..94a1c5a2 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -854,9 +854,12 @@ processParms (ast *func, ast *newType = NULL; sym_link *ftype; - if (IS_CAST_OP (*actParm) || + /* don't perform integer promotion of explicitly typecasted variable arguments + * if sdcc extensions are enabled */ + if (options.std_sdcc && + (IS_CAST_OP (*actParm) || (IS_AST_SYM_VALUE (*actParm) && AST_VALUES (*actParm, removedCast)) || - (IS_AST_LIT_VALUE (*actParm) && AST_VALUES (*actParm, literalFromCast))) + (IS_AST_LIT_VALUE (*actParm) && AST_VALUES (*actParm, literalFromCast)))) { /* Parameter was explicitly typecast; don't touch it. */ return 0; -- 2.47.2