This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/53934] New: Better CPP macro diagnostics


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]