[Bug fortran/53934] New: Better CPP macro diagnostics
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 12 07:48:00 GMT 2012
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
More information about the Gcc-bugs
mailing list