bug-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-glpk] Re: C++ and glpk


From: Andrew Makhorin
Subject: [Bug-glpk] Re: C++ and glpk
Date: Tue, 24 Jun 2003 09:01:24 +0400

>I have converted version 4.0 to run under the MSVC6, MSVC7, and
>gcc3.2(cygwin) compilers as C++ files.
>
>This took a bit of editing, but nothing complicated.   The main issue
>was casting void pointers to something else.
>
>About 500 lines of code were needed to be modified, but these were
>trivial modifications that could easily be made to be compatible with
>ANSI C compilers also.

I think to replace umalloc and ucalloc by some macros which will return
pointers of appropriate type. This will allow the C compiler detecting
potential bugs like that you reported about and also compiling all glpk
modules as if they were written in C++ (glpk is written in a subset of
ANSI C and I believe there is nothing specific to C which would be
incompatible with C++). However I do not completely understand why the
standard linkage extern "C" { ... } is not fit for your needs.

>In the process I discovered a couple of items you may wish to correct
>regardless of C++ compatibility.
>
>Found something that looks fishy in glplpx6a.c file.
>The line 1056 allocates SPX.refsp as doubles but SPX header declares as
>int*
>in the glpspx.h file.
>
>glpmip1.c line 641:  Allocating array of sizeof(void*) and assigning to
>IESITEM**.
>This probably works on all platforms but is a bit sloppy.

Thank you for your information. In fact, these are potential bugs.


Andrew Makhorin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]