public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/101317] New: Bind(C): improve error checking in  CFI_* functions declared in ISO_Fortran_binding.h
@ 2021-07-04 18:01 sandra at gcc dot gnu.org
  2021-07-17  1:05 ` [Bug libfortran/101317] " sandra at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sandra at gcc dot gnu.org @ 2021-07-04 18:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101317
           Summary: Bind(C): improve error checking in  CFI_* functions
                    declared in ISO_Fortran_binding.h
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sandra at gcc dot gnu.org
  Target Milestone: ---

ISO_Fortran_binding.h defines macros to indicate error conditions in functions
such as CFI_establish, CFI_setpointer, etc that are declared in that header;
it's table 18.5 in the 2018 Fortran standard.  There seems to be no actual
requirement that the library functions detect and return particular error codes
(IIUC the "shall be" language in the argument descriptions implies undefined
behavior otherwise), but the functions already do detect some errors with
-fcheck=all.  However, I noted some other easy-to-detect errors are not being
checked.

Test cases are library/establish-errors.f90 and library/setpointer-errors.f90,
in the WIP TS 29113 testsuite.

https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574115.html

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

* [Bug libfortran/101317] Bind(C): improve error checking in  CFI_* functions declared in ISO_Fortran_binding.h
  2021-07-04 18:01 [Bug libfortran/101317] New: Bind(C): improve error checking in CFI_* functions declared in ISO_Fortran_binding.h sandra at gcc dot gnu.org
@ 2021-07-17  1:05 ` sandra at gcc dot gnu.org
  2021-07-28  4:25 ` cvs-commit at gcc dot gnu.org
  2021-07-28 20:22 ` sandra at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: sandra at gcc dot gnu.org @ 2021-07-17  1:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from sandra at gcc dot gnu.org ---
Patch posted:

https://gcc.gnu.org/pipermail/fortran/2021-July/056249.html

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

* [Bug libfortran/101317] Bind(C): improve error checking in  CFI_* functions declared in ISO_Fortran_binding.h
  2021-07-04 18:01 [Bug libfortran/101317] New: Bind(C): improve error checking in CFI_* functions declared in ISO_Fortran_binding.h sandra at gcc dot gnu.org
  2021-07-17  1:05 ` [Bug libfortran/101317] " sandra at gcc dot gnu.org
@ 2021-07-28  4:25 ` cvs-commit at gcc dot gnu.org
  2021-07-28 20:22 ` sandra at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-28  4:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Sandra Loosemore <sandra@gcc.gnu.org>:

https://gcc.gnu.org/g:e78480ad0983cf75813af5e02d68cdad09e441e9

commit r12-2555-ge78480ad0983cf75813af5e02d68cdad09e441e9
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Thu Jul 15 08:48:45 2021 -0700

    Bind(c): Improve error checking in CFI_* functions

    This patch adds additional run-time checking for invalid arguments to
    CFI_establish and CFI_setpointer.  It also changes existing messages
    throughout the CFI_* functions to use PRIiPTR to format CFI_index_t
    values instead of casting them to int and using %d (which may not work
    on targets where int is a smaller type), simplifies wording of some
    messages, and fixes issues with capitalization, typos, and the like.
    Additionally some coding standards problems such as >80 character lines
    are addressed.

    2021-07-24  Sandra Loosemore  <sandra@codesourcery.com>

            PR libfortran/101317

    libgfortran/
            * runtime/ISO_Fortran_binding.c: Include <inttypes.h>.
            (CFI_address): Tidy error messages and comments.
            (CFI_allocate): Likewise.
            (CFI_deallocate): Likewise.
            (CFI_establish): Likewise.  Add new checks for validity of
            elem_len when it's used, plus type argument and extents.
            (CFI_is_contiguous): Tidy error messages and comments.
            (CFI_section): Likewise.  Refactor some repetitive code to
            make it more understandable.
            (CFI_select_part): Likewise.
            (CFI_setpointer): Likewise.  Check that source is not an
            unallocated allocatable array or an assumed-size array.

    gcc/testsuite/
            * gfortran.dg/ISO_Fortran_binding_17.f90: Fix typo in error
            message patterns.

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

* [Bug libfortran/101317] Bind(C): improve error checking in  CFI_* functions declared in ISO_Fortran_binding.h
  2021-07-04 18:01 [Bug libfortran/101317] New: Bind(C): improve error checking in CFI_* functions declared in ISO_Fortran_binding.h sandra at gcc dot gnu.org
  2021-07-17  1:05 ` [Bug libfortran/101317] " sandra at gcc dot gnu.org
  2021-07-28  4:25 ` cvs-commit at gcc dot gnu.org
@ 2021-07-28 20:22 ` sandra at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: sandra at gcc dot gnu.org @ 2021-07-28 20:22 UTC (permalink / raw)
  To: gcc-bugs

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

sandra at gcc dot gnu.org changed:

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

--- Comment #3 from sandra at gcc dot gnu.org ---
Fixed on trunk.

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

end of thread, other threads:[~2021-07-28 20:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-04 18:01 [Bug libfortran/101317] New: Bind(C): improve error checking in CFI_* functions declared in ISO_Fortran_binding.h sandra at gcc dot gnu.org
2021-07-17  1:05 ` [Bug libfortran/101317] " sandra at gcc dot gnu.org
2021-07-28  4:25 ` cvs-commit at gcc dot gnu.org
2021-07-28 20:22 ` sandra 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).