Author Topic: How to expand compiler variable containing spaces without quotes  (Read 11305 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: How to expand compiler variable containing spaces without quotes
« Reply #15 on: September 28, 2011, 08:35:33 pm »
Now someone should implement it  :lol:  8)
Done in trunk.

BTW: I figured out a bad "bug":
What does not work for all these macros is something like:
$TO_ABSOLUTE_PATH{%APPDATA%} (on Windows, for example), as the platform specific macros (environment variables) are being replaced at last (which HAS to be like that!). Unfortunately this spoils things I had in mind with the TO_PATH_83 macro. I don't have a good solution other than for these (path's related) macros check for inner platform macros first that point to path's, but this seems very hacky to me. :-(

Does any of you have a good idea for these cases?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Oleg_Sam

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: How to expand compiler variable containing spaces without quotes
« Reply #16 on: November 28, 2011, 01:38:08 pm »
The $REMOVE_QUOTES{} macros is not work on CB svn7549 Debugger Branch on WinXp SP3.
To reproduce it :
1. Create any project, for example, Console Application
2. Build this Project, all works OK.
3. Create Custom variable ADD_OPTIONS = -Wextra -Wmain (the quotes is automaticaly added)
4. In Compiler settings -> Other options type  $REMOVE_QUOTES{$(ADD_OPTIONS)}
5. Build this Project.. after this CB is hangs up and crashes  :(

Thanks.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to expand compiler variable containing spaces without quotes
« Reply #17 on: November 28, 2011, 02:57:35 pm »
Does it work with the normal nightly?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Oleg_Sam

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: How to expand compiler variable containing spaces without quotes
« Reply #18 on: November 28, 2011, 03:11:31 pm »
I dont know, because I use only debugger branch.. :(

Offline Oleg_Sam

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: How to expand compiler variable containing spaces without quotes
« Reply #19 on: November 28, 2011, 03:32:05 pm »
I just test it on normal nightly svn7550, and this macro also not work and CB crashes :(

Offline Oleg_Sam

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: How to expand compiler variable containing spaces without quotes
« Reply #20 on: November 28, 2011, 05:57:58 pm »
When I type $REMOVE_QUOTES{"-Wextra -Wmain"} on Compiler settings -> Other options
it works fine. I suppose, that global variables not replaced in this macros.

Thanks.