public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/53934] New: Better CPP macro diagnostics
@ 2012-07-12  7:48 burnus at gcc dot gnu.org
  2012-10-09  9:15 ` [Bug fortran/53934] " manu at gcc dot gnu.org
  2014-04-16 20:26 ` manu at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-07-12  7:48 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/53934] Better CPP macro diagnostics
  2012-07-12  7:48 [Bug fortran/53934] New: Better CPP macro diagnostics burnus at gcc dot gnu.org
@ 2012-10-09  9:15 ` manu at gcc dot gnu.org
  2014-04-16 20:26 ` manu at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: manu at gcc dot gnu.org @ 2012-10-09  9:15 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53934

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-10-09 09:15:10 UTC ---
(In reply to comment #0)
> Expected: Something similar. Possibly related to PR44054 and PR53552

See tree-diagnostic.c: maybe_unwind_expanded_macro_loc.

You could reimplement it in gfortran using fortran diagnostics machinery. But
if you reimplemented the gfortran diagnostics machinery in terms of the general
diagnostics machinery, it will just work (and you will also fix those PRs).
Note that the function does not use anything C/C++ specific, not even
tree-specific.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/53934] Better CPP macro diagnostics
  2012-07-12  7:48 [Bug fortran/53934] New: Better CPP macro diagnostics burnus at gcc dot gnu.org
  2012-10-09  9:15 ` [Bug fortran/53934] " manu at gcc dot gnu.org
@ 2014-04-16 20:26 ` manu at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: manu at gcc dot gnu.org @ 2014-04-16 20:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53934
Bug 53934 depends on bug 53552, which changed state.

Bug 53552 Summary: Add support for !GCC$ warning directive (cf. #pragma warning)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53552

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-16 20:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-12  7:48 [Bug fortran/53934] New: Better CPP macro diagnostics burnus at gcc dot gnu.org
2012-10-09  9:15 ` [Bug fortran/53934] " manu at gcc dot gnu.org
2014-04-16 20:26 ` manu at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).