Author Topic: passing string as "Custom variables" or "#define" breaks the CB  (Read 3383 times)

Offline shenc

  • Single posting newcomer
  • *
  • Posts: 6
passing string as "Custom variables" or "#define" breaks the CB
« on: February 03, 2017, 10:00:13 pm »
I need to pass a version string from makefile so I define it as -DVERSION='"1.1.1.0"' in "Other compiler option"  or in "#defines" field as VERSION='"1.1.1.0"'.  It breaks CB, CB does not compile.  If I remove this string  CB compiles.  So I am sure it is this string breaks CB.
I also tried
-DVERSION='\"1.1.1.0\"'
-DVERSION=\'"1.1.1.0"\'

only
-DVERSION=\'"1.1.1.0"\'

works.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: passing string as "Custom variables" or "#define" breaks the CB
« Reply #1 on: February 04, 2017, 01:32:01 am »
What do you mean by breaks?
(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 shenc

  • Single posting newcomer
  • *
  • Posts: 6
Re: passing string as "Custom variables" or "#define" breaks the CB
« Reply #2 on: February 06, 2017, 08:59:25 pm »
CB does not compile.  BTW, when I copy the project to other location.  CB changes \'"1.1.1.0"\'  to /'"1.1.1.0"/'  by itself.  I need change it back to \'"1.1.1.0"\' to compile.  The behavior is verified.  I think it is a bug.

« Last Edit: February 06, 2017, 09:01:17 pm by shenc »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: passing string as "Custom variables" or "#define" breaks the CB
« Reply #3 on: February 07, 2017, 12:12:05 am »
My magic ball is broken. Please describe the problem in better detail!
(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 sodev

  • Regular
  • ***
  • Posts: 497
Re: passing string as "Custom variables" or "#define" breaks the CB
« Reply #4 on: February 07, 2017, 01:17:27 am »
The question is most likely how to properly quote #defines in the compiler settings to define a value for a #define that wouldnt work in a plain way e.g. if it contains spaces. Various forms of different quoting either break the assembly of the compile command so that strange errors happen or CodeBlocks habits to switch path separators around break the quoting.