This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Interoperability and compiler compatibility
- From: Arjen Markus <arjen dot markus895 at gmail dot com>
- To: FX <fxcoudert at gmail dot com>
- Cc: Tom Cook <tom dot k dot cook at gmail dot com>, Fortran List <fortran at gcc dot gnu dot org>
- Date: Wed, 15 Oct 2014 08:58:35 +0200
- Subject: Re: Interoperability and compiler compatibility
- Authentication-results: sourceware.org; auth=none
- References: <CAFSh4UyXGDeHuFc3wJzoc9y1Odk2-Nk6_QK0FNKyCPBGg0XscA at mail dot gmail dot com> <943BC081-6D4B-45B1-B3CE-0C5B0AF26B31 at gmail dot com>
An alternative solution might be to create a C header file with a set
of C preprocessor macros, like:
#define PRINTSTR printstr
...
and incorporate that header file in the C sources. That way you do not
have to change the actual C source.
Regards,
Arjen
2014-10-15 8:44 GMT+02:00 FX <fxcoudert@gmail.com>:
>
>> There are approximate 240 such functions in the code base, called a
>> total of about 400 times, so any code change is going to be a fairly
>> major investment. I'm hoping there is some compiler option that I
>> have yet to find that will sort this out for me. Does it exist?
>
> No. Butâ
>
>> Barring that, is my best option to modify the Intel-based build to
>> emit lower-case names and rename all these functions to lower case in
>> the C code?
>
> Yes, that sounds like the best option, with minimal modifications. It is also the default option for Intel and many other compilers, anyway.
>
> If your C code has homogeneous coding style, a systematic change is relatively simple to make. A function would be anything that matches the regular expression "^\s*(void|int|float|double)\s+[A-Z0-9]+(" so you could do it e.g. with a sed command:
>
> sed -e "s@^\(\s*(void|int|float|double)\s+\)\([A-Z0-9]+\s*\)(@\1\L\2(@"
>
> Then review the changes.
> Hope this helps.
>
> FX