This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Interoperability and compiler compatibility


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]