public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32957] C/Fortran interoperability and -fdefault-integer-8
       [not found] <bug-32957-4@http.gcc.gnu.org/bugzilla/>
@ 2011-12-27 11:19 ` dominiq at lps dot ens.fr
  0 siblings, 0 replies; 5+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-12-27 11:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-12-27 11:14:24 UTC ---
Created attachment 26187
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26187
patch to fix some failures with -fdefault-integer-8

I have this patch in my tree for a quite long time. It fixes some failures with
-fdefault-integer-8 by replacing some implicit kinds with explicit ones.


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

* [Bug fortran/32957] C/Fortran interoperability and -fdefault-integer-8
  2007-08-01 14:56 [Bug fortran/32957] New: " dominiq at lps dot ens dot fr
                   ` (2 preceding siblings ...)
  2007-10-05 12:44 ` fxcoudert at gcc dot gnu dot org
@ 2009-12-06 10:52 ` dominiq at lps dot ens dot fr
  3 siblings, 0 replies; 5+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-12-06 10:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dominiq at lps dot ens dot fr  2009-12-06 10:52 -------
If I apply the following patch:

--- c_loc_tests_2.f03   2009-11-25 18:17:45.000000000 +0100
+++ c_loc_tests_2_db_1.f03      2009-12-06 11:43:31.000000000 +0100
@@ -44,13 +44,13 @@ contains
   end subroutine test0

   subroutine test1() bind(c)
-    integer, target, dimension(100) :: int_array_tar
+    integer(c_int), target, dimension(100) :: int_array_tar
     type(c_ptr) :: my_c_ptr_1 = c_null_ptr
     type(c_ptr) :: my_c_ptr_2 = c_null_ptr

-    int_array_tar = 100
+    int_array_tar = 100_c_int
     my_c_ptr_1 = c_loc(int_array_tar)
-    if(test_array_address(my_c_ptr_1, 100) .ne. 1) then
+    if(test_array_address(my_c_ptr_1, 100_c_int) .ne. 1) then
        call abort()
     end if
   end subroutine test1

the test passes with -fdefault-integer-8. Note that

gfc -fdefault-integer-8 c_loc_tests_2_db_1.f03 c_loc_tests_2_funcs.c

gives a warning:

cc1: warning: command line option "-fdefault-integer-8" is valid for Fortran
but not for C

Although such warning can be trapped by adding in gcc/testsuite/lib/prune.exp
lines such that

     regsub -all "(^|\n)cc1: warning: command line option .-fwhole-file. is
valid for Fortran but not for C" $text "" text

it would be better to change the gfortran script to not pass gfortran options
to other languages.

If there is any interest in updating the interoperability tests to works with
-fdefault-*-8, I can comb the testsuite.


-- 


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


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

* [Bug fortran/32957] C/Fortran interoperability and -fdefault-integer-8
  2007-08-01 14:56 [Bug fortran/32957] New: " dominiq at lps dot ens dot fr
  2007-08-01 15:04 ` [Bug fortran/32957] " kargl at gcc dot gnu dot org
  2007-08-02 17:08 ` dominiq at lps dot ens dot fr
@ 2007-10-05 12:44 ` fxcoudert at gcc dot gnu dot org
  2009-12-06 10:52 ` dominiq at lps dot ens dot fr
  3 siblings, 0 replies; 5+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-10-05 12:44 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-05 12:44:03
               date|                            |


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


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

* [Bug fortran/32957] C/Fortran interoperability and -fdefault-integer-8
  2007-08-01 14:56 [Bug fortran/32957] New: " dominiq at lps dot ens dot fr
  2007-08-01 15:04 ` [Bug fortran/32957] " kargl at gcc dot gnu dot org
@ 2007-08-02 17:08 ` dominiq at lps dot ens dot fr
  2007-10-05 12:44 ` fxcoudert at gcc dot gnu dot org
  2009-12-06 10:52 ` dominiq at lps dot ens dot fr
  3 siblings, 0 replies; 5+ messages in thread
From: dominiq at lps dot ens dot fr @ 2007-08-02 17:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dominiq at lps dot ens dot fr  2007-08-02 17:08 -------
Subject: Re:  C/Fortran interoperability and
 -fdefault-integer-8

> A check of this option can be inserted at various locations during
> the parsing.

Certainly, but this will give a very interesting exercise to build test cases!


-- 


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


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

* [Bug fortran/32957] C/Fortran interoperability and -fdefault-integer-8
  2007-08-01 14:56 [Bug fortran/32957] New: " dominiq at lps dot ens dot fr
@ 2007-08-01 15:04 ` kargl at gcc dot gnu dot org
  2007-08-02 17:08 ` dominiq at lps dot ens dot fr
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-08-01 15:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from kargl at gcc dot gnu dot org  2007-08-01 15:04 -------
At this point, the easiest fix is probably going to be to document
that -fdefault-integer-8 should not be used with bind(c) code.  A
check of this option can be inserted at various locations during the
parsing.


-- 


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


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

end of thread, other threads:[~2011-12-27 11:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-32957-4@http.gcc.gnu.org/bugzilla/>
2011-12-27 11:19 ` [Bug fortran/32957] C/Fortran interoperability and -fdefault-integer-8 dominiq at lps dot ens.fr
2007-08-01 14:56 [Bug fortran/32957] New: " dominiq at lps dot ens dot fr
2007-08-01 15:04 ` [Bug fortran/32957] " kargl at gcc dot gnu dot org
2007-08-02 17:08 ` dominiq at lps dot ens dot fr
2007-10-05 12:44 ` fxcoudert at gcc dot gnu dot org
2009-12-06 10:52 ` dominiq at lps dot ens dot fr

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).