From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27564 invoked by alias); 12 Jul 2012 07:48:48 -0000 Received: (qmail 27553 invoked by uid 22791); 12 Jul 2012 07:48:46 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Jul 2012 07:48:22 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/53934] New: Better CPP macro diagnostics Date: Thu, 12 Jul 2012 07:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-07/txt/msg00927.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53934 Bug #: 53934 Summary: Better CPP macro diagnostics Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org Depends on: 44054, 53552 GCC has (now) for the following C program the nice warning: foo.c:1:23: error: invalid operands to binary << (have =E2=80=98int=E2=80= =99 and =E2=80=98double=E2=80=99) #define MOVE(a,b) (a << (b)) ^ foo.c:4:7: note: in expansion of macro 'MOVE' i =3D MOVE(12,2.2); ^ /* ------------------ */ #define MOVE(a,b) (a << (b)) foo(){ int i; i =3D MOVE(12,2.2); } While for Fortran one just gets: foo.F90:2.14: i =3D lshift(1, 1.1) 1 Error: 'shift' argument of 'lshift' intrinsic at (1) must be INTEGER which is less helpful. #define MOVE(a,b) lshift(a,b) integer :: i i =3D MOVE(1, 1.1) end Expected: Something similar. Possibly related to PR44054 and PR53552