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

FX Coudert fxcoudert@gmail.com
Mon Jul 9 22:51:00 GMT 2007


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:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: set_options.ChangeLog
Type: application/octet-stream
Size: 493 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070709/222eab93/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: set_options.diff
Type: application/octet-stream
Size: 6255 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070709/222eab93/attachment-0001.obj>


More information about the Gcc-patches mailing list