https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94382

            Bug ID: 94382
           Summary: conflicting function types should show more context
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: matthew at wil dot cx
  Target Milestone: ---

The diagnostic would be better if it showed the entire function prototype:

../fs/iomap/apply.c:13:1: error: conflicting types for ‘__iomap_apply’
   13 | __iomap_apply(struct inode *inode, loff_t pos, loff_t length, unsigned
flags,
      | ^~~~~~~~~~~~~
In file included from ../fs/iomap/apply.c:9:
../include/linux/iomap.h:152:1: note: previous declaration of ‘__iomap_apply’
was here
  152 | __iomap_apply(struct inode *inode, loff_t pos, loff_t length, unsigned
flags,
      | ^~~~~~~~~~~~~

$ grep -A3 __iomap_apply include/linux/iomap.h fs/iomap/apply.c 
include/linux/iomap.h:__iomap_apply(struct inode *inode, loff_t pos, loff_t
length, unsigned flags,
include/linux/iomap.h-          const struct iomap_ops *ops, iomap_actor_t
actor,
include/linux/iomap.h-          struct iomap *iomap, struct iomap *srcmap);
include/linux/iomap.h-
--
include/linux/iomap.h:  length = __iomap_apply(inode, pos, length, flags, ops,
actor,
include/linux/iomap.h-                                  &iomap, &srcmap);
include/linux/iomap.h-  /*
include/linux/iomap.h-   * Now that we have guaranteed that the space
allocation will succeed,
--
fs/iomap/apply.c:__iomap_apply(struct inode *inode, loff_t pos, loff_t length,
unsigned flags,
fs/iomap/apply.c-               struct iomap *iomap, struct iomap *srcmap,
fs/iomap/apply.c-               const struct iomap_ops *ops, iomap_actor_t
actor)
fs/iomap/apply.c-{

The bug in my code is fairly obvious, but the diagnostic doesn't show the part
of the function signature that doesn't match.

Reply via email to