#1 graphmat.C doesn't compile under C++

closed-rejected
None
5
2005-11-07
2005-10-14
Anonymous
No

Under:
g++ --version
g++ (GCC) 3.2.2
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying
conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

more /proc/version
Linux version 2.4.21-4.EL (buildsys@builder) (gcc
version 3.2.3 20030502 (Red Ha
t Linux 3.2.3-20)) #1 Sat Dec 13 19:47:38 CST 2003

graphmat.C doesn't compile. Looking at the header
graphmat.h is hte #define

#define gm_ALLOC(type, ptr, func) ((type *) \ gm_alloc(ptr,
func, sizeof(type))

This will not compile because there is a missing ) on
the define.

Also, I can not get this block to compile
static int default_gm_error();
/***** initialisation of general error-routine ******/
int (*gm_error)() = default_gm_error;
/****** General error-routine ******/
static int
default_gm_error(gm_errno, gm_func)
gm_error_t gm_errno;
char *gm_func;
{
<snip>

it is complaining about types not matching. The .h
does need to change the def for default_gm_error() to
be an int return, not a void return.

Also, the entire C file defines methods as
static int
default_gm_error(gm_errno, gm_func)
gm_error_t gm_errno;
char *gm_func;
{
<snip>

which I can not get to compile without changing it to
static int
default_gm_error(gm_error_t gm_errno, char *gm_func)
{
<snip>

Discussion

  • Klamer Schutte

    Klamer Schutte - 2005-11-07
    • assigned_to: nobody --> klamer
     
  • Klamer Schutte

    Klamer Schutte - 2005-11-07
    • status: open --> open-rejected
     
  • Klamer Schutte

    Klamer Schutte - 2005-11-07

    Logged In: YES
    user_id=7696

    There is no graphmat.C file, there only is a graphmat.c file.

    As such, it is a C file and not a C++ file. This also is
    reflected in the Makefile supplied.

    Compiling with a C++ compiler is not supported. Happily, as
    you use g++ I am sure that gcc also is available on your
    platform...

    Issue closed.

     
  • Klamer Schutte

    Klamer Schutte - 2005-11-07
    • status: open-rejected --> closed-rejected
     

Log in to post a comment.