This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch] Tiny fix of LINK_COMMAND_SPEC


Kaz Kojima wrote:
* gcc.c (LINK_COMMAND_SPEC): Add space after %(link_ssp).

I ran into this problem myself while trying to write docs for the -fstack-protector option.


The relevant clue is in gcc.c handle_brace_body, the first comment, which says
/* Locate the closing } or ;, honoring nested braces.
Trim trailing whitespace. */
So white space before a trailing } is always ignored. The code implementing this is a few lines down where end_body is decremented.


So I think we need to changes to properly fix this:
1) The useless space at the end of LINK_SPP_SPEC should be deleted.
2) The missing space in LINK_COMMAND_SPEC should be added.

You have the second one, but not the first. This is patch is OK if you add the missing part.

Jakub expressed concerns about adding unnecessary spaces if LINK_SPP_SPEC expands to nothing, but that isn't a problem. We already collapse multiple white space chars. Just look at the @c spec in gcc.c for instance, which has lots of tabs and spaces which are harmless.
--
Jim Wilson, GNU Tools Support, http://www.specifix.com



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