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]

[gfortran,patch] Pass command-line options to libgfortran in a more ABI-stable manner


Hi all,

I've been wanting to write this patch for more than a year now, and it's here at last. Some important compile-time options are passed to the library to influence runtime behaviour (-std value, -pedantic, - fbacktrace, -fcore-dump flags). This is currently done by a function with the following prototype :
_gfortran_set_std (int warn_std, int allow_std, int pedantic, int backtrace, int dump_core);


This does not easily accomodate evolutions by adding a new flag and passing it to the library, while keeping the ABI stable. On the contrary, I propose to change this function call into:
_gfortran_set_options (int num, int options[]);
where num is the number of options that the front-end knows about and has put into options[]. For this reason it is easy to change the _gfortran_set_options code so that, for older code, we initialize the new options with default values yielding the same behaviour as before.


Bootstrapped and regtested on x86_64-linux, OK for mainline? (I keep the old function around, so that we don't break ABI for such a little reorganization)


:ADDPATCH fortran:


Attachment: set_options.ChangeLog
Description: Binary data

Attachment: set_options.diff
Description: Binary data


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