Opened 7 years ago

Closed 7 years ago

#1714 closed defect (fixed)

r.terraflow does not compile

Reported by: cmbarton Owned by: grass-dev@…
Priority: blocker Milestone: 6.4.3
Component: Default Version: svn-releasebranch64
Keywords: r.terraflow Cc:
CPU: Unspecified Platform: Unspecified

Description

In the latest update of 6.4.3 svn, r.terraflow does not compile, at least on the Mac. Here is the error:

Michaels-MacBook-Air:r.terraflow cmbarton$ make
c++ -c -I/Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include  -arch i386 -isysroot /Developer/SDKs/MacOSX10.6.sdk   -DUSER=\"cmbarton\" -DNODATA_FIX -D_FILE_OFFSET_BITS=64   -DPACKAGE=\""grassmods"\" -DELEV_FLOAT main.cc -o OBJ.x86_64-apple-darwin12.1.0/FLOAT/main.o
In file included from main.cc:39:
In file included from ./common.h:27:
In file included from /Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/iostream/ami.h:39:
In file included from /Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/iostream/empq_impl.h:26:
In file included from /Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/iostream/empq.h:33:
/Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/iostream/embuffer.h:1123:56: error: 
      default arguments cannot be added to an out-of-line definition of a member of a class template
long em_buffer<T,Key>::insert(AMI_STREAM<T>* str, long bos=0) {
                                                       ^   ~
In file included from main.cc:39:
In file included from ./common.h:27:
In file included from /Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/iostream/ami.h:39:
In file included from /Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/iostream/empq_impl.h:26:
In file included from /Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/iostream/empq.h:35:
/Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/iostream/minmaxheap.h:494:7: error: 
      reference to non-static member function must be called; did you mean to call it with no
      arguments?
  if (size) {
      ^~~~
          ()
main.cc:181:16: warning: format string is not a string literal (potentially insecure)
      [-Wformat-security]
        G_fatal_error(_("Unable to create temp dir"));
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/glocale.h:10:16: note: 
      expanded from macro '_'
#define _(str) G_gettext(PACKAGE,(str))
               ^~~~~~~~~~~~~~~~~~~~~~~~
main.cc:191:15: warning: format string is not a string literal (potentially insecure)
      [-Wformat-security]
    G_warning(_("The '-q' flag is superseded and will be removed "
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/glocale.h:10:16: note: 
      expanded from macro '_'
#define _(str) G_gettext(PACKAGE,(str))
               ^~~~~~~~~~~~~~~~~~~~~~~~
main.cc:367:19: warning: format string is not a string literal (potentially insecure)
      [-Wformat-security]
    G_fatal_error(_("cannot read range"));
                  ^~~~~~~~~~~~~~~~~~~~~~
/Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/glocale.h:10:16: note: 
      expanded from macro '_'
#define _(str) G_gettext(PACKAGE,(str))
               ^~~~~~~~~~~~~~~~~~~~~~~~
main.cc:389:19: warning: format string is not a string literal (potentially insecure)
      [-Wformat-security]
    G_fatal_error(_("cannot write colors"));
                  ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/glocale.h:10:16: note: 
      expanded from macro '_'
#define _(str) G_gettext(PACKAGE,(str))
               ^~~~~~~~~~~~~~~~~~~~~~~~
main.cc:407:19: warning: format string is not a string literal (potentially insecure)
      [-Wformat-security]
    G_fatal_error(_("cannot read range"));
                  ^~~~~~~~~~~~~~~~~~~~~~
/Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/glocale.h:10:16: note: 
      expanded from macro '_'
#define _(str) G_gettext(PACKAGE,(str))
               ^~~~~~~~~~~~~~~~~~~~~~~~
main.cc:414:19: warning: format string is not a string literal (potentially insecure)
      [-Wformat-security]
    G_fatal_error(_("cannot write colors"));
                  ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/glocale.h:10:16: note: 
      expanded from macro '_'
#define _(str) G_gettext(PACKAGE,(str))
               ^~~~~~~~~~~~~~~~~~~~~~~~
main.cc:434:44: warning: format specifies type 'int' but the argument has type 'unsigned long'
      [-Wformat]
  G_message( "\t\t FILL: %s [%d elements, %dB each]",
                                          ~^
                                          %ld
main.cc:437:45: warning: format specifies type 'int' but the argument has type 'unsigned long'
      [-Wformat]
  G_message( "\t\t FLOW: %s [%ld elements, %dB each]",
                                           ~^
                                           %ld
8 warnings and 2 errors generated.
make: *** [OBJ.x86_64-apple-darwin12.1.0/FLOAT/main.o] Error 1
Michaels-MacBook-Air:r.terraflow cmbarton$ 

Change History (5)

comment:1 Changed 7 years ago by cmbarton

This also affects devbranch 6 (6.5).

comment:2 Changed 7 years ago by cmbarton

Doesn't compile in GRASS 7 either

comment:3 in reply to:  description ; Changed 7 years ago by glynn

Replying to cmbarton:

In the latest update of 6.4.3 svn, r.terraflow does not compile, at least on the Mac. Here is the error:

/Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/iostream/embuffer.h:1123:56: error: 
      default arguments cannot be added to an out-of-line definition of a member of a class template

This is almost exactly the same issue as #1676 (fixed in r52130). No idea why it hasn't been an issue until now.

/Users/Shared/grass_dev/grass64_rb/dist.x86_64-apple-darwin12.1.0/include/grass/iostream/minmaxheap.h:494:7: error: 
      reference to non-static member function must be called; did you mean to call it with no
      arguments?

I have even less idea why this hasn't been caught before.

Both should be fixed (in 7.0) by r53077.

comment:4 in reply to:  3 Changed 7 years ago by neteler

Replying to glynn: ...

I have even less idea why this hasn't been caught before.

Both should be fixed (in 7.0) by r53077.

Backported to 6.4 and 6.5 in r53094 and r53095.

comment:5 Changed 7 years ago by neteler

Resolution: fixed
Status: newclosed

Closing since it should be fixed on all branches and trunk. Reopen if needed.

Note: See TracTickets for help on using tickets.