Author Topic: [BUG/mingw] Code::Blocks adds quotes only if there are spaces in a path  (Read 371 times)

Offline Dmitri

  • Single posting newcomer
  • *
  • Posts: 7
For some reason C::B behaves like this. It should add quotes for any paths (output, intermediate dir, source and output files, ...) in any case.

Offline raynebc

  • Almost regular
  • **
  • Posts: 142
Re: [BUG/mingw] Code::Blocks adds quotes only if there are spaces in a path
« Reply #1 on: November 10, 2017, 07:23:16 pm »
Why should it add quotation marks in a scenario when they are not required for proper functionality?

Offline Dmitri

  • Single posting newcomer
  • *
  • Posts: 7
Re: [BUG/mingw] Code::Blocks adds quotes only if there are spaces in a path
« Reply #2 on: November 11, 2017, 11:35:34 am »
They are actually required "for proper functionality". Take this as a simple rule.
What if you have an environment variable in your path, which contains a string with spaces?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10356
Re: [BUG/mingw] Code::Blocks adds quotes only if there are spaces in a path
« Reply #3 on: November 11, 2017, 11:41:26 am »
We will expand the variable and then we'll decide if we need to add quotes or not, I guess.
This discussion is pointless if you don't show concrete examples where cb produces wrong paths.

And keep in mind that sometimes adding quotes could confuse programs which doesn't expect them, so it is not as easy as always-put-quotes around paths...
<debugger plugin maintainer>
(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 Dmitri

  • Single posting newcomer
  • *
  • Posts: 7
Re: [BUG/mingw] Code::Blocks adds quotes only if there are spaces in a path
« Reply #4 on: November 11, 2017, 12:14:39 pm »
Here's a concrete example for you:
1. Create a folder on your desktop, and put spaces into its name. Example: "fol der".
2. Create a C::B project in this folder.
3. Change output path to $(PROJECT_DIR)\output
4. Try to compile your project with mingw-64 compiler.

And we're not talking about abstract programs, it's Code::Blocks and mingw only.
« Last Edit: November 11, 2017, 12:27:07 pm by Dmitri »

Offline raynebc

  • Almost regular
  • **
  • Posts: 142
Re: [BUG/mingw] Code::Blocks adds quotes only if there are spaces in a path
« Reply #5 on: November 11, 2017, 06:28:49 pm »
If you manually put quotation marks around your output path, does it work?

Offline Dmitri

  • Single posting newcomer
  • *
  • Posts: 7
Re: [BUG/mingw] Code::Blocks adds quotes only if there are spaces in a path
« Reply #6 on: November 12, 2017, 11:53:50 am »
No, it won't work.

Offline raynebc

  • Almost regular
  • **
  • Posts: 142
Re: [BUG/mingw] Code::Blocks adds quotes only if there are spaces in a path
« Reply #7 on: November 12, 2017, 05:33:18 pm »
I would think that means one of two things:
1.  If there are quotes around it, perhaps C::B doesn't expand the $(PROJECT_DIR) variable?
2.  C::B putting quotes around it wouldn't have worked anyway as one of the other parts of the toolchain won't support this path as oBFusCATed suggested.  You'd need to change the project path to one without spaces.

Offline Dmitri

  • Single posting newcomer
  • *
  • Posts: 7
Re: [BUG/mingw] Code::Blocks adds quotes only if there are spaces in a path
« Reply #8 on: November 12, 2017, 05:45:16 pm »
Which part of toolchain will cause problems?
Also, did you ever work with mingw compiler?

Offline raynebc

  • Almost regular
  • **
  • Posts: 142
Re: [BUG/mingw] Code::Blocks adds quotes only if there are spaces in a path
« Reply #9 on: November 12, 2017, 09:21:10 pm »
I use MinGW (first party MinGW, not the third party MinGW-64) exclusively, but then again I don't put spaces in my project paths because I don't want to have to troubleshoot any problems that may come of it.  If you remove the $(PROJECT_DIR) variable and explicitly define the path with quotation marks, does it work?  If not, then this isn't a problem C::B can solve because the compiler isn't allowing you to use the path containing spaces.

Offline Dmitri

  • Single posting newcomer
  • *
  • Posts: 7
Re: [BUG/mingw] Code::Blocks adds quotes only if there are spaces in a path
« Reply #10 on: November 14, 2017, 09:30:45 am »
Mingw can work with parameters that are embraced with quotation marks, that's not a problem with compiler.
Can anyone from developers check if there's a real problem exists with expanding variables in such cases?

I use MinGW (first party MinGW, not the third party MinGW-64) exclusively
Isn't it outdated? I know it was not updated with C++14.
« Last Edit: November 14, 2017, 09:35:13 am by Dmitri »

Offline raynebc

  • Almost regular
  • **
  • Posts: 142
Re: [BUG/mingw] Code::Blocks adds quotes only if there are spaces in a path
« Reply #11 on: November 15, 2017, 07:40:12 am »
I can't immediately tell that MinGW supports C++14.