public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, fortran] PR35019 - joined and sparated arguments to options (2nd try)
@ 2008-03-28 12:35 Daniel Franke
  2008-04-04 14:34 ` Ping: " Daniel Franke
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Franke @ 2008-03-28 12:35 UTC (permalink / raw)
  To: fortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]


http://gcc.gnu.org/onlinedocs/gccint/Option-properties.html

Joined
Separate
The option takes a mandatory argument. Joined indicates that the option and 
argument can be included in the same argv entry (as with -mflush-func=name, 
for example). Separate indicates that the option and argument can be separate 
argv entries (as with -o). An option is allowed to have both of these 
properties. 


Unfortunately, this seems to be part of the truth only. The first patch [1] 
added the above properties to I and J in fortran/lang.opt, however, currently 
only -I works as expected, the options -J and -fintrinsic-modules-path don't. 
The only difference between -I and -J I could find was in gcc.h were a macro 
(DEFAULT_SWITCH_TAKES_ARG) lists options that take arguments; -I was listed 
there, -J wasn't. Adding -J to the list of options that take arguments fixes 
the problem. 

Why one needs to list the options in said macro and why this information is 
not extracted from the .opt file eludes me.

:ADDPATCH gcc/fortran:

gcc:
2008-03-28  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/35019
	* gcc.h: Added fortran options that take arguments to
	DEFAULT_SWITCH_TAKES_ARG and DEFAULT_WORD_SWITCH_TAKES_ARG macros.

gcc/fortran:
2008-03-28  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/35019
	* gfortranspec.c (lookup_option): Poperly handle separated arguments 
	in -J option, print missing argument message when necessary.


Bootstrapped and regression tested on i686-pc-linux-gnu. Ok for trunk?

Regards
	Daniel


[1] http://gcc.gnu.org/ml/fortran/2008-02/msg00079.html

[-- Attachment #2: pr35019.diff --]
[-- Type: text/x-diff, Size: 1614 bytes --]

Index: gcc.h
===================================================================
--- gcc.h	(revision 133396)
+++ gcc.h	(working copy)
@@ -35,9 +35,9 @@ struct spec_function
 #define DEFAULT_SWITCH_TAKES_ARG(CHAR) \
   ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
    || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
-   || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
-   || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
-   || (CHAR) == 'B' || (CHAR) == 'b')
+   || (CHAR) == 'I' || (CHAR) == 'J' || (CHAR) == 'm' \
+   || (CHAR) == 'x' || (CHAR) == 'L' || (CHAR) == 'A' \
+   || (CHAR) == 'V' || (CHAR) == 'B' || (CHAR) == 'b')
 
 /* This defines which multi-letter switches take arguments.  */
 
@@ -50,7 +50,8 @@ struct spec_function
   || !strcmp (STR, "iquote") || !strcmp (STR, "isystem") \
   || !strcmp (STR, "isysroot") \
   || !strcmp (STR, "-param") || !strcmp (STR, "specs") \
-  || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ"))
+  || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ") \
+  || !strcmp(STR, "fintrinsic-modules-path"))
 
 
 /* These are exported by gcc.c.  */
Index: fortran/gfortranspec.c
===================================================================
--- fortran/gfortranspec.c	(revision 133396)
+++ fortran/gfortranspec.c	(working copy)
@@ -175,6 +175,8 @@ lookup_option (Option *xopt, int *xskip,
     opt = OPTION_v, skip = 0;
   else if (text[1] == 'x')
     opt = OPTION_x, arg = text + 2;
+  else if (text[1] == 'J')
+    ;
   else
     {
       if ((skip = WORD_SWITCH_TAKES_ARG (text + 1)) != 0)  /* See gcc.c.  */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Ping: [patch, fortran] PR35019 - joined and sparated arguments to options (2nd try)
  2008-03-28 12:35 [patch, fortran] PR35019 - joined and sparated arguments to options (2nd try) Daniel Franke
@ 2008-04-04 14:34 ` Daniel Franke
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Franke @ 2008-04-04 14:34 UTC (permalink / raw)
  To: fortran; +Cc: gcc-patches

On Friday 28 March 2008 11:35:00 Daniel Franke wrote:
http://gcc.gnu.org/ml/gcc-patches/2008-03/msg01777.html

> gcc:
> 2008-03-28  Daniel Franke  <franke.daniel@gmail.com>
>
> 	PR fortran/35019
> 	* gcc.h: Added fortran options that take arguments to
> 	DEFAULT_SWITCH_TAKES_ARG and DEFAULT_WORD_SWITCH_TAKES_ARG macros.
>
> gcc/fortran:
> 2008-03-28  Daniel Franke  <franke.daniel@gmail.com>
>
> 	PR fortran/35019
> 	* gfortranspec.c (lookup_option): Properly handle separated arguments
> 	in -J option, print missing argument message when necessary.

Could a C or global maintainer be so kind comment on this?

Thanks
	Daniel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-04 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-28 12:35 [patch, fortran] PR35019 - joined and sparated arguments to options (2nd try) Daniel Franke
2008-04-04 14:34 ` Ping: " Daniel Franke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).