This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/53934] New: Better CPP macro diagnostics
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Jul 2012 07:48:19 +0000
- Subject: [Bug fortran/53934] New: Better CPP macro diagnostics
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53934
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 âintâ and âdoubleâ)
#define MOVE(a,b) (a << (b))
^
foo.c:4:7: note: in expansion of macro 'MOVE'
i = MOVE(12,2.2);
^
/* ------------------ */
#define MOVE(a,b) (a << (b))
foo(){
int i;
i = MOVE(12,2.2);
}
While for Fortran one just gets:
foo.F90:2.14:
i = 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 = MOVE(1, 1.1)
end
Expected: Something similar. Possibly related to PR44054 and PR53552