Author Topic: The 27-31 October 2007 build will NOT be out.  (Read 51788 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5142
The 27-31 October 2007 build will NOT be out.
« on: October 28, 2007, 03:39:19 pm »
some changes coming in the nightly builds :

- will use wx286
- will use MinGW 4.2.1
- will now be build in a virtual machine [Xp in OpenSuse10.3 or OpenSuse 10.2] instead of native windows

so everyone who knows how to get rid of the new warnings we get in windows with MinGW 4.2.1 feel free to post here below on how to solve them

[hint hint : an interesting one to solve is propgrid.h]

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: The 27-31 October 2007 build will NOT be out.
« Reply #1 on: October 28, 2007, 05:02:33 pm »
The problem with "propgrid.h" are the multiline string constants taht are no loanger allowed afaik.
In gcc4.2 a warning is generated in gcc4.3 its an error and compiling breaks.

I don't find a compiler- (or preprocessor-) switch to change this behaviour.

So the only (and of course the clean way) is to patch "propgrid.h" and turn the linebraks in the string to "\n", or to upgrade wxpropgrid, what would lead to other (more difficult) problems with wxSmith-code, if I remember a post from byo right.

In the actual version of "propgrid.h" the first lines that lead to this warning look as followed:
Code: [Select]
            "Registers Python type/class to property mapping.\n\nfactory: Property builder function/class."
instead of
Code: [Select]
            """\
            Registers Python type/class to property mapping.

            factory: Property builder function/class.
            """

By the way which version of MinGW 4.2.1 is to be used ?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: The 27-31 October 2007 build will NOT be out.
« Reply #2 on: October 28, 2007, 05:23:05 pm »
I've created a patch for "propgrid.h" and "manager.h" : http://jens.lody.name/debian/patches/propgrid.patch

The annoying warnings about deprecated string-conversions can be stopped with the flag "-Wwrite-strings" .

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: The 27-31 October 2007 build will NOT be out.
« Reply #3 on: October 28, 2007, 09:02:10 pm »
For the wxWidgets headers, you'll have to add -Wno-attributes to the compile-time options until it's fixed upstream.

For the "deprecated conversion from string constant to..." errors, you can either add "-Wno-write-strings" to the compile-time options or fix the warning by making functions accept char const* (or the equivalent const char*) instead of just char*. The vast majority of these errors turned up in non-C::B-original code, so my patch uses -Wno-write-strings for those and fixes the single instance in C::B-original code (Append() in AutoBuffer in filemanager.h).

For the fun stuff in wxPropertyGrid, it appears that the preprocessor no longer entirely skips code within conditionals that evaluate to false; it's at least trying to tokenize the Python code and failing. Only fix is to remove the offending bits; I chose to just get rid of the entire SWIG section, since we don't use it.

In Editor.cxx and ScintillaBase.cxx from Scintilla, the fix is to add another set of curly brackets "{}" for correctness around all the zero initializers.

The attached patch is against r4566; it successfully compiles (with no errors or warnings) and runs with both GCC 3.4.5 and 4.2.1-dw2-2.

EDIT:
I also spotted another  no-no in AutoBuffer in filemanager.h: using a std::auto_ptr to bind an array (see here and here). It happens to work for now in GCC using simple objects, but it is undefined in ISO-C++ (the array is freed with delete instead of delete[]).

[attachment deleted by admin]
« Last Edit: October 28, 2007, 09:14:00 pm by TDragon »
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5142
Re: The 27-31 October 2007 build will NOT be out.
« Reply #4 on: October 28, 2007, 09:55:44 pm »
Quote
For the wxWidgets headers, you'll have to add -Wno-attributes to the compile-time options until it's fixed upstream.

This had already been done, every windows cbp of CB includes a project build script.

Quote
warnings about deprecated string-conversion
I think we should solve those correctly and not suppress, assuming this would become errors in GCC4.3.

My builds will be dw2 based.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: The 27-31 October 2007 build will NOT be out.
« Reply #5 on: October 28, 2007, 10:03:46 pm »
I think we should solve those correctly and not suppress, assuming this would become errors in GCC4.3.
I can come up with a patch for this if you like, but if you ever want to update the sources from upstream then all my work would magically disappear...
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5142
Re: The 27-31 October 2007 build will NOT be out.
« Reply #6 on: October 28, 2007, 10:40:36 pm »
well , I always upgrade wxFlatNotebook (@Eran : if you are reading this, did you already to solve this warning issue, and is it save to sync to your latest svn state since i was planning to upgrade but haven't looked at your latest source for a while now??)

If for the other the changes are small (haven't looked at them yet), then we should go for it.


EDIT : in our source tree I have adjusted the code to get rid of the warnings, basically adding some const's and 1 time casting away the const :-(
« Last Edit: October 28, 2007, 11:07:37 pm by killerbot »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6466
    • My Best Post
Re: The 27-31 October 2007 build will NOT be out.
« Reply #7 on: October 28, 2007, 10:54:05 pm »
FYI:

I am working on back porting the changes in wxPropertyGrid 1.2.9 headers for SWIG multi-line strings to Code::Blocks.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: The 27-31 October 2007 build will NOT be out.
« Reply #8 on: October 28, 2007, 11:06:08 pm »
I repeat myself:
I've created a patch for "propgrid.h" and "manager.h" : http://jens.lody.name/debian/patches/propgrid.patch
The patch fixes the multiline problems, and "progrid.h" and "manager.h" compile without a warning.

It is not a supression of warnings like the -Wwrite-strings (at least under linux there is no "-Wno-write"-strings documented).

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5142
Re: The 27-31 October 2007 build will NOT be out.
« Reply #9 on: October 28, 2007, 11:09:29 pm »
I have merged your patch Jens.

@Tim : interesting to see the backport, then we have what the future might bring.

@TDragon : preferred Jens' solution for the moment, code looks more like it was before then

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6466
    • My Best Post
Re: The 27-31 October 2007 build will NOT be out.
« Reply #10 on: October 28, 2007, 11:51:12 pm »
C::B complains about this line in wxflatnotebook's popup_dlg.cpp

img.SetAlpha((unsigned char*)signpost_alpha, true);

Edit: The error is still needs fixed, spoke too soon.

sdk\wxFlatNotebook/libwxflatnotebook.a(popup_dlg.o):F:/SourceCode/Projects/IDEs/CodeBlocks/codeblocks/src/sdk/wxFlatNotebook/src/wxFlatNotebook/popup_dlg.cpp:187: undefined reference to `signpost_alpha

Note, the file popup_dlg.cpp also has formatting issues related to linefeeds.
( The formatting might be caused by my SVN Client testing TortoiseSVN Beta)

Tim S

« Last Edit: October 29, 2007, 12:47:01 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jan van den Borst

  • Multiple posting newcomer
  • *
  • Posts: 99
Re: The 27-31 October 2007 build will NOT be out.
« Reply #11 on: October 29, 2007, 12:17:09 am »
How do I setup MINGW 4.2.1?

Jan

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: The 27-31 October 2007 build will NOT be out.
« Reply #12 on: October 29, 2007, 12:21:34 am »
jens:
... (at least under linux there is no "-Wno-write"-strings documented).

Quote from: GCC 4.2.1 Manual
Each of these specific warning options also has a negative form beginning `-Wno-' to turn off warnings; for example, -Wno-implicit. This manual lists only one of the two forms, whichever is not the default.
...
-Wwrite-strings
When compiling C, give string constants the type const char[length] so that copying the address of one into a non-const char * pointer will get a warning; when compiling C++, warn about the deprecated conversion from string literals to char *. This warning, by default, is enabled for C++ programs. These warnings will help you find at compile time code that can try to write into a string constant, but only if you have been very careful about using const in declarations and prototypes. Otherwise, it will just be a nuisance; this is why we did not make -Wall request these warnings.

-Wwrite-strings doesn't turn off the warnings, it enables them (i.e., has no effect when compiling C++). Try it yourself.

killerbot:
Handle the wxPG files however you like; none of the code between the #ifdef SWIG conditionals is being used anyway. I'd like to point out that casting const away is almost never a good idea; I'm taking a closer look at the code now.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: The 27-31 October 2007 build will NOT be out.
« Reply #13 on: October 29, 2007, 12:34:16 am »
jens:
... (at least under linux there is no "-Wno-write"-strings documented).

Quote from: GCC 4.2.1 Manual
Each of these specific warning options also has a negative form beginning `-Wno-' to turn off warnings; for example, -Wno-implicit. This manual lists only one of the two forms, whichever is not the default.
...
-Wwrite-strings
When compiling C, give string constants the type const char[length] so that copying the address of one into a non-const char * pointer will get a warning; when compiling C++, warn about the deprecated conversion from string literals to char *. This warning, by default, is enabled for C++ programs. These warnings will help you find at compile time code that can try to write into a string constant, but only if you have been very careful about using const in declarations and prototypes. Otherwise, it will just be a nuisance; this is why we did not make -Wall request these warnings.

-Wwrite-strings doesn't turn off the warnings, it enables them (i.e., has no effect when compiling C++). Try it yourself.

You are right of course. :oops:

Thank you for correcting me  !

Offline Steven 'lazalong'

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: The 27-31 October 2007 build will NOT be out.
« Reply #14 on: October 29, 2007, 02:50:42 am »
I've created a patch for "propgrid.h" and "manager.h" : http://jens.lody.name/debian/patches/propgrid.patch

It could be useful to submit your patch to the propgrid tracker:
http://sourceforge.net/tracker/?group_id=133406
-------------------------------
OGE - www.opengameengine.org