Author Topic: The 27 July 2009 build (5716) is out.  (Read 104773 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 27 July 2009 build (5716) is out.
« Reply #30 on: July 30, 2009, 11:30:02 pm »
which is a change to 'compilercommandgenerator.cpp' base upon work of 'Biplab' : "replace macros for compiler options".
Basically 2 lines have been added, doing a macro substitution, could it be it is carried out too early ??
It seems so.

In ReplaceMacros, we replace macros and environment-variables.
Our internally used variables have the same format as the unix/linux shell-variables (if used without braces), so they get replaced by the appropriate environment variable, but such a variable does not exist, so we get an empty string instead.

ReplaceMacros should be called after our variables get expanded, not before.

EDIT:

and as I just saw, ReplaceMacros is called at the  end GenerateCommandline, so it I do not think, that there is any cause to call it so early as we do it in the moment (after the changes in commit 5636.
There might be a problem , if a user tries to add C::B variables with a script, but that does not work anyway (unless they are added with two $'s), because the variables get expanded after the scripts.

So my proposal is to revert commit 5636, unless we find a way to protect C::B's internal variables.

« Last Edit: July 30, 2009, 11:40:48 pm by jens »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: The 27 July 2009 build (5716) is out.
« Reply #31 on: July 31, 2009, 08:20:25 am »
So my proposal is to revert commit 5636, unless we find a way to protect C::B's internal variables.
Agreed. Still: It works for me on Windows even with the patch!!!

EDIT: I've taken the action accordingly.
« Last Edit: July 31, 2009, 08:25:41 am by MortenMacFly »
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 sbilsing

  • Single posting newcomer
  • *
  • Posts: 3
Re: The 27 July 2009 build (5716) is out.
« Reply #32 on: July 31, 2009, 08:34:21 am »
The workaround to double the $ works for me, too. :-)
I should have mentioned, that I use the macro in the project's compiler settings, not in the global compiler settings. In the global settings everything seems fine.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: The 27 July 2009 build (5716) is out.
« Reply #33 on: July 31, 2009, 09:04:26 am »
In the global settings everything seems fine.
Now THAT clarifies why it seemed to work for me. ;-)
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 sdfwds4

  • Single posting newcomer
  • *
  • Posts: 7
Re: The 27 July 2009 build (5716) is out.
« Reply #34 on: August 01, 2009, 07:33:24 pm »
brace completion is good, i like it, thank you!

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: The 27 July 2009 build (5716) is out.
« Reply #35 on: August 02, 2009, 04:39:05 pm »
which is a change to 'compilercommandgenerator.cpp' base upon work of 'Biplab' : "replace macros for compiler options".
Basically 2 lines have been added, doing a macro substitution, could it be it is carried out too early ??

I can't access Berlios at the moment. So I'm unable to shed more light on this. Anyway it's already been reverted and I'll see if the earlier patch can be improved or not. :)
Be a part of the solution, not a part of the problem.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: The 27 July 2009 build (5716) is out.
« Reply #36 on: August 02, 2009, 09:46:42 pm »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline vix

  • Multiple posting newcomer
  • *
  • Posts: 60
Re: The 27 July 2009 build (5716) is out.
« Reply #37 on: August 03, 2009, 04:49:23 pm »
Sorry for my insistence,...
only to be sure that someone could confirm the File Encoding problem (see my previous post).
I can't use C::B anymore in this situation because all the characters like à, è, ò, ... are messed up.
And my C/C++ comments are full of them because they're quite common in Italian language (but I think also in French, Spanish, ...)

At the end I had to switch back to the old 5678 Nightly Build, but if I made some mistake during upgrading I could try to solve it....

Thanks for your help

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 27 July 2009 build (5716) is out.
« Reply #38 on: August 03, 2009, 05:28:31 pm »
Sorry for my insistence,...
only to be sure that someone could confirm the File Encoding problem (see my previous post).
I can't use C::B anymore in this situation because all the characters like à, è, ò, ... are messed up.
And my C/C++ comments are full of them because they're quite common in Italian language (but I think also in French, Spanish, ...)

At the end I had to switch back to the old 5678 Nightly Build, but if I made some mistake during upgrading I could try to solve it....

Thanks for your help

Because the latest two version of night build uses a mozilla file encoding detection scheme, so, it works better than the old 5678 in my Chinese system. :D

Not sure it works badly in your system.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 27 July 2009 build (5716) is out.
« Reply #39 on: August 03, 2009, 05:29:55 pm »
Sorry for my insistence,...
only to be sure that someone could confirm the File Encoding problem (see my previous post).
I can't use C::B anymore in this situation because all the characters like à, è, ò, ... are messed up.
And my C/C++ comments are full of them because they're quite common in Italian language (but I think also in French, Spanish, ...)

At the end I had to switch back to the old 5678 Nightly Build, but if I made some mistake during upgrading I could try to solve it....

Thanks for your help
I can confirm this (on wondows), and will have a look into it.
The encoding detection has also changed with the change to wxAui.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 27 July 2009 build (5716) is out.
« Reply #40 on: August 04, 2009, 01:59:57 am »
@vix:
could you please send me example-files that fail, if possible ?
see: http://forums.codeblocks.org/index.php/topic,10191.msg70572.html#msg70572
Files with extremly less (non-ascii) characters are always hard to decode.

It might help to switch to multibyte-encoding (utf-8), if this is a legal alternative.

Offline vix

  • Multiple posting newcomer
  • *
  • Posts: 60
Re: The 27 July 2009 build (5716) is out.
« Reply #41 on: August 04, 2009, 08:24:01 am »
could you please send me example-files that fail, if possible ?

just sent

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 27 July 2009 build (5716) is out.
« Reply #42 on: August 04, 2009, 09:09:54 am »
could you please send me example-files that fail, if possible ?

just sent
The reason is quite simple, I decided to also search for latin-2 encoding needed for langauges like Bosnian, Croatian, Czech, Hungarian, Polish, Romanian, Serbian (when in the Latin script), Slovak, Slovenian, Upper Sorbian, and Lower Sorbian, but it breaks some latin-1 encoded texts due to their similarity, not all and not always (depending of the used characters).
FireFox 3.5 still does not automatically detect these languages correctly (at least not in all cases).

I think I will add a configuration-option that the user can decide whether he/she wants to try to detect latin-2 also (with a hint, that it might break latin-1 detection).

I don't know a better solution, the alternative would be either not to detect latin-2 or some latin-1 encodings.

By the way: I did not stumble over the problem, because if you use german umlauts (äöü) or the german sharp s (ß), even single-byte texts are detected correctly, but I use utf-8 in almost any cases anyways (except for at work where I have to use windows tools, that do not all work with unicode correctly).

Offline vix

  • Multiple posting newcomer
  • *
  • Posts: 60
Re: The 27 July 2009 build (5716) is out.
« Reply #43 on: August 04, 2009, 11:54:40 am »
The reason is quite simple, I decided to also search for latin-2 encoding needed for langauges like Bosnian, Croatian, Czech, Hungarian, Polish, Romanian, Serbian (when in the Latin script), Slovak, Slovenian, Upper Sorbian, and Lower Sorbian, but it breaks some latin-1 encoded texts due to their similarity, not all and not always (depending of the used characters).

If I understood, the encoding is not saved into the file, so C::B tries to guess the right one when the file is opened. So when you add the latin-2 encoding, some latin-1 files are seen as latin-2, so some characters are displayed in a wrong way.
So I change the option Settings >> Editor >> General Settings >> Use This Encoding to "As default encoding", so the C::B's auto-detectionis bypassed, and this solved my problem.

If this is the situation, I think that your idea of the configuration-option is the easiest one: I'm afraid that detecting latin-1 from latin-2 is not easy...

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: The 27 July 2009 build (5716) is out.
« Reply #44 on: August 04, 2009, 06:11:26 pm »
If I understood, the encoding is not saved into the file, so C::B tries to guess the right one when the file is opened. So when you add the latin-2 encoding, some latin-1 files are seen as latin-2, so some characters are displayed in a wrong way.
So I change the option Settings >> Editor >> General Settings >> Use This Encoding to "As default encoding", so the C::B's auto-detectionis bypassed, and this solved my problem.

If this is the situation, I think that your idea of the configuration-option is the easiest one: I'm afraid that detecting latin-1 from latin-2 is not easy...


A file encoding is never saved to a file. At least I'm unaware of any widely popular method of storing file encoding data to a file. Reason is pretty simple. One need to strip that data (encoding detection data) before feeding it to another program. Or the other program should be aware of how to strip that data.

Most of the known software performs encoding detection by sampling data from file. There are BOM for UTF encoded file. But for other encoding sampling and measuring frequency of encoded characters is the only way to detect an encoding. Mozilla's encoding detection is an example of this.

For a large project with files encoded with a less popular encoding scheme will surely degrade Code:Blocks' performance. Precisely this was the reason Yiannis objected (long ago) to the inclusion of Mozilla's encoding detection code to trunk. IMHO it should be turned on as an Option only.

IMHO the solution should be to give user two option.
1) Use a simple encoding detection scheme (to detect most of the popular encodings).
2) Use Mozilla's code to detect encoding (we should make it very clear that this option may affect performance in some cases).
3) Don't detect encoding.

And to each of the above options Fallback Encoding options shall be-
a) Use System encoding.
b) Use User-provided encoding.

Code:Blocks is an IDE & IMO we should try not to transform it to a Text Editor or a Browser.
Be a part of the solution, not a part of the problem.