public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/52168] New: fixinclude test failure for complex.h on netbsd
@ 2012-02-08  9:29 redi at gcc dot gnu.org
  2012-02-08 10:20 ` [Bug other/52168] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2012-02-08  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52168
           Summary: fixinclude test failure for complex.h on netbsd
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


Bootstrapped using the default BSD sed, awk etc.


complex.h /home/jwakely/src/full/gcc/fixincludes/tests/base/complex.h differ:
char 839, line 41
*** complex.h   Wed Feb  8 10:21:00 2012
--- /home/jwakely/src/full/gcc/fixincludes/tests/base/complex.h Mon Nov  7
09:52:51 2011
***************
*** 38,43 ****
  #if defined( SOLARIS_COMPLEX_CXX_CHECK )
  #ifdef        __cplusplus
  extern "C" {
! #endif#ifdef  __cplusplus
  }
! #endif#endif  /* SOLARIS_COMPLEX_CXX_CHECK */
--- 38,45 ----
  #if defined( SOLARIS_COMPLEX_CXX_CHECK )
  #ifdef        __cplusplus
  extern "C" {
! #endif
! #ifdef        __cplusplus
  }
! #endif
! #endif  /* SOLARIS_COMPLEX_CXX_CHECK */

There were fixinclude test FAILURES


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

* [Bug other/52168] fixinclude test failure for complex.h on netbsd
  2012-02-08  9:29 [Bug other/52168] New: fixinclude test failure for complex.h on netbsd redi at gcc dot gnu.org
@ 2012-02-08 10:20 ` rguenth at gcc dot gnu.org
  2012-02-09  0:38 ` redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-08 10:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-08 10:19:50 UTC ---
Weird original formatting in complex.h


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

* [Bug other/52168] fixinclude test failure for complex.h on netbsd
  2012-02-08  9:29 [Bug other/52168] New: fixinclude test failure for complex.h on netbsd redi at gcc dot gnu.org
  2012-02-08 10:20 ` [Bug other/52168] " rguenth at gcc dot gnu.org
@ 2012-02-09  0:38 ` redi at gcc dot gnu.org
  2012-02-09  9:21 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2012-02-09  0:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-02-09 00:37:58 UTC ---
The problem is that netbsd's sed doesn't put a newline after a 'c' command, so
the two 'endif' here (from fixincl.x) don't get newlines after them:

/*
 *  Fix Command Arguments for Solaris_Complex_Cxx
 */
static const char* apzSolaris_Complex_CxxPatch[] = { sed_cmd_z,
    "-e", "/#if[ \t]*!defined(__cplusplus)/c\\\n\
#ifdef\t__cplusplus\\\n\
extern \"C\" {\\\n\
#endif",
    "-e", "/#endif[ \t]*\\/\\* !defined(__cplusplus) \\*\\//c\\\n\
#ifdef\t__cplusplus\\\n\
}\\\n\
#endif",
    (char*)NULL };


With GNU sed:

$ { echo foo ; echo bar ; }  | sed '/foo/c\                              
baz'
baz                                                                           
bar

But with netbsd sed:

$ { echo foo ; echo bar ; } | sed '/foo/c\
baz'
bazbar


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

* [Bug other/52168] fixinclude test failure for complex.h on netbsd
  2012-02-08  9:29 [Bug other/52168] New: fixinclude test failure for complex.h on netbsd redi at gcc dot gnu.org
  2012-02-08 10:20 ` [Bug other/52168] " rguenth at gcc dot gnu.org
  2012-02-09  0:38 ` redi at gcc dot gnu.org
@ 2012-02-09  9:21 ` jakub at gcc dot gnu.org
  2012-02-09 12:20 ` redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-09  9:21 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |korbb at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-09 09:20:21 UTC ---
This isn't the only issue we had with sed c command, see
http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01110.html
And this is the only spot in fixincl that uses it.  Can't it be rewritten with
without sed somehow (c_test/c_fix* ?)?


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

* [Bug other/52168] fixinclude test failure for complex.h on netbsd
  2012-02-08  9:29 [Bug other/52168] New: fixinclude test failure for complex.h on netbsd redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-02-09  9:21 ` jakub at gcc dot gnu.org
@ 2012-02-09 12:20 ` redi at gcc dot gnu.org
  2012-02-09 12:25 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2012-02-09 12:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-02-09 12:19:38 UTC ---
NetBSD PR http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45955

My analysis of the problem was incorrect and it looks as though a fix would be
to put an *unescaped* \n at the end of each -e script:

 /*
  *  Fix Command Arguments for Solaris_Complex_Cxx
  */
 static const char* apzSolaris_Complex_CxxPatch[] = { sed_cmd_z,
     "-e", "/#if[ \t]*!defined(__cplusplus)/c\\\n\
 #ifdef\t__cplusplus\\\n\
 extern \"C\" {\\\n\
-#endif",
+#endif\n",
     "-e", "/#endif[ \t]*\\/\\* !defined(__cplusplus) \\*\\//c\\\n\
 #ifdef\t__cplusplus\\\n\
 }\\\n\
-#endif",
+#endif\n",
     (char*)NULL };

POSIX requires that a newline in the replacement text be escaped with \ so an
unescaped newline is not part of the replacement text.  GNU and Solaris both
correctly ignore an unescaped newline at the end of the script, apparently
netbsd does too (but I can't test that until later today)


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

* [Bug other/52168] fixinclude test failure for complex.h on netbsd
  2012-02-08  9:29 [Bug other/52168] New: fixinclude test failure for complex.h on netbsd redi at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-02-09 12:20 ` redi at gcc dot gnu.org
@ 2012-02-09 12:25 ` redi at gcc dot gnu.org
  2012-02-09 21:32 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2012-02-09 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-02-09 12:24:14 UTC ---
(In reply to comment #4)
> netbsd does too (but I can't test that until later today)

or rather, it doesn't ignore the newline, but it does produce the expected
result


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

* [Bug other/52168] fixinclude test failure for complex.h on netbsd
  2012-02-08  9:29 [Bug other/52168] New: fixinclude test failure for complex.h on netbsd redi at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-02-09 12:25 ` redi at gcc dot gnu.org
@ 2012-02-09 21:32 ` redi at gcc dot gnu.org
  2012-02-09 21:58 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2012-02-09 21:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-02-09 21:31:48 UTC ---
Created attachment 26633
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26633
replace 'c' command with 'i' and 'd'

this passes the tests on gnu/linux and netbsd


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

* [Bug other/52168] fixinclude test failure for complex.h on netbsd
  2012-02-08  9:29 [Bug other/52168] New: fixinclude test failure for complex.h on netbsd redi at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-02-09 21:32 ` redi at gcc dot gnu.org
@ 2012-02-09 21:58 ` redi at gcc dot gnu.org
  2012-02-09 22:03 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2012-02-09 21:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #26633|0                           |1
        is obsolete|                            |

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-02-09 21:58:24 UTC ---
Created attachment 26634
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26634
group the i and d functions

equivalent, but avoids repeating the context address by grouping the functions
in braces

also passes all tests on both gnu/linux and netbsd


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

* [Bug other/52168] fixinclude test failure for complex.h on netbsd
  2012-02-08  9:29 [Bug other/52168] New: fixinclude test failure for complex.h on netbsd redi at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2012-02-09 21:58 ` redi at gcc dot gnu.org
@ 2012-02-09 22:03 ` redi at gcc dot gnu.org
  2014-11-16  6:41 ` richard at netbsd dot org
  2014-11-16 14:29 ` redi at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2012-02-09 22:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-02-09 22:03:14 UTC ---
priority -> minor because it doesn't really matter if a fixinclude for Solaris
doesn't work on netbsd, except for causing a test faulre


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

* [Bug other/52168] fixinclude test failure for complex.h on netbsd
  2012-02-08  9:29 [Bug other/52168] New: fixinclude test failure for complex.h on netbsd redi at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2012-02-09 22:03 ` redi at gcc dot gnu.org
@ 2014-11-16  6:41 ` richard at netbsd dot org
  2014-11-16 14:29 ` redi at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: richard at netbsd dot org @ 2014-11-16  6:41 UTC (permalink / raw)
  To: gcc-bugs

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

Richard PALO <richard at netbsd dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |richard at netbsd dot org

--- Comment #9 from Richard PALO <richard at netbsd dot org> ---
(In reply to Jonathan Wakely from comment #8)
> priority -> minor because it doesn't really matter if a fixinclude for
> Solaris doesn't work on netbsd, except for causing a test faulre

Except that this issue is also present for solaris pkgsrc developers.

+1 for the patch


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

* [Bug other/52168] fixinclude test failure for complex.h on netbsd
  2012-02-08  9:29 [Bug other/52168] New: fixinclude test failure for complex.h on netbsd redi at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2014-11-16  6:41 ` richard at netbsd dot org
@ 2014-11-16 14:29 ` redi at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2014-11-16 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-11-16
     Ever confirmed|0                           |1
           Severity|minor                       |normal


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

end of thread, other threads:[~2014-11-16 14:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-08  9:29 [Bug other/52168] New: fixinclude test failure for complex.h on netbsd redi at gcc dot gnu.org
2012-02-08 10:20 ` [Bug other/52168] " rguenth at gcc dot gnu.org
2012-02-09  0:38 ` redi at gcc dot gnu.org
2012-02-09  9:21 ` jakub at gcc dot gnu.org
2012-02-09 12:20 ` redi at gcc dot gnu.org
2012-02-09 12:25 ` redi at gcc dot gnu.org
2012-02-09 21:32 ` redi at gcc dot gnu.org
2012-02-09 21:58 ` redi at gcc dot gnu.org
2012-02-09 22:03 ` redi at gcc dot gnu.org
2014-11-16  6:41 ` richard at netbsd dot org
2014-11-16 14:29 ` redi 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).