[EMBOSS] incorporating old code in 2.9.0
pmr at ebi.ac.uk
Fri Jul 23 10:29:54 UTC 2004
Derek Gatherer wrote:
> However, the old code is now failing at make with 2.9.0. The errors are
> slightly different for each but all are incompatible types in assignment.
> For instance, with one I get:
> incompatible type for argument 2 of `ajSeqReplace'
> and another:
> incompatible type for argument 1 of `ajStrChar'
> Is this because something has changed in nucleus/ajax etc which
> precludes the use of the old code?
Curious that you get errors. Passing an AjPStr to these functions should be fine.
If you send me an example program it should be easy to fix.
In cleaning up the code for 2.9.0 we have become strict about defining "const
AjPStr" and "const char*" for read-only parameters.
You may see some messages about return types - functions will now return a
"const AjPStr" or a "const char*" which can cause you problems if you assign
them to a non-const variable. Usually, copying them allows you to fix code
easily. Tehre were some issues with the EMBOSS code, but nobody else using the
current CVS code reported difficulties while we were nitroducing the changes.
In the case of these two functions, the prototypes are now:
void ajSeqReplace (AjPSeq thys, const AjPStr seq);
char ajStrChar (const AjPStr thys, ajint pos);
One issue is that the definition of AjPStr itself had to change to be a macro,
so perhaps there is something strange with your include files or dependencies.
AjPStr was part of the "typedef" for strings, but somehow compilers all fail
to understand "const AjPStr" (they made the pointer constant) so it is now a
macro that translates to "AjOStr*" and that means "const AjPStr" translates to
"const AjOStr*" which is understood correctly by compilers (they make the
string constant - strictly, they make the next level of the structure
constant, which is all C compilers can do).
By the way - we will all be in Glasgow next week for BOSC and ISMB - I expect
we will see you there?
More information about the EMBOSS