Skip to content

Fix many GCC compile warnings and some errors#1663

Closed
marcows wants to merge 15 commits intonotepad-plus-plus:masterfrom
marcows:gcc-fixes
Closed

Fix many GCC compile warnings and some errors#1663
marcows wants to merge 15 commits intonotepad-plus-plus:masterfrom
marcows:gcc-fixes

Conversation

@marcows
Copy link
Copy Markdown
Contributor

@marcows marcows commented Mar 20, 2016

Fixes #1662

The MinGW build is not successful anymore since addition of the file browser. This pull request doesn't fix this problem.

@donho
Copy link
Copy Markdown
Member

donho commented Mar 21, 2016

This pull request doesn't fix this problem.

???

@marcows
Copy link
Copy Markdown
Contributor Author

marcows commented Mar 21, 2016

This pull request doesn't fix this problem.
???
Sorry for the confusing description, this was just meant as additional information.

Rewording:
This pull request fixes many GCC compile warnings and some errors.
However, some problems with MinGW, introduced by the recent addition of the file browser, are not fixed and still cause compile errors.

@marcows
Copy link
Copy Markdown
Contributor Author

marcows commented May 4, 2016

I have just pushed the branch with a new commit, which adds a minimal FileBrowser stub for MinGW. Now it can be built and is running successfully again because the unsupported ATL is not used anymore. There were no changes to the original source files needed for this.

@mzbab88 Try out this reworked branch.

@marcows marcows closed this May 4, 2016
@marcows marcows reopened this May 4, 2016
marcows added 15 commits May 16, 2016 18:46
Error message e.g.:
extra qualification 'ScintillaEditView::' on member 'langNames' [-fpermissive]
…HAR*

Error messages:
invalid conversion from 'const TCHAR* {aka const wchar_t*}' to 'TCHAR* {aka wchar_t*}' [-fpermissive]
invalid conversion from 'const wchar_t*' to 'TCHAR* {aka wchar_t*}' [-fpermissive]
…to 'char*'

Warning messages:
deprecated conversion from string constant to 'char*' [-Wwrite-strings]
deprecated conversion from string constant to 'wchar_t*' [-Wwrite-strings]
deprecated conversion from string constant to 'TCHAR* {aka wchar_t*}' [-Wwrite-strings]

Still warnings when using -std=c++11 or -std=c++14:
ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
ISO C++ forbids converting a string constant to 'TCHAR* {aka wchar_t*}' [-Wwrite-strings]
Warning message:
inline function 'void ScintillaEditView::makeStyle(LangType, const TCHAR**)' used but never defined
…Wconversion-null]

Warning messages:
converting to non-pointer type 'int' from NULL [-Wconversion-null]
converting to non-pointer type 'uptr_t {aka long unsigned int}' from NULL [-Wconversion-null]
converting to non-pointer type 'Document {aka long int}' from NULL [-Wconversion-null]
This feature cannot be built because ATL is not supported.

Building and running successfully now without the file browser feature.
could not convert 'false' from 'bool' to 'generic_string {aka std::__cxx11::basic_string<wchar_t>}'

With GCC 5.3.0 it was a warning:
converting 'false' to pointer type for argument 1 of 'std::[..]'
…W stubs

Necessary since addition of "Log Monitoring (tail -f)" feature.
@milipili
Copy link
Copy Markdown
Contributor

Closing since merge conflict but I will take care of that using the current patch.

@milipili milipili closed this Jun 23, 2016
@marcows
Copy link
Copy Markdown
Contributor Author

marcows commented Jun 23, 2016

I have rebased my branch, conflicts resolved:
https://github.com/marcows/notepad-plus-plus/tree/gcc-fixes

@marcows
Copy link
Copy Markdown
Contributor Author

marcows commented Aug 12, 2016

Rebased after conflicts and new errors.
With Linux/Wine (MinGW 5.3.0) I get a std:exception now, with Windows 7 (MinGW 5) it is running. When reverting the changes in PowerEditor/src/Notepad_plus.cpp from commit bd37378 it is running with Linux/Wine again.

@dail8859
Copy link
Copy Markdown
Contributor

I ran this code snippet in ideone and it gives:

terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid

Which appears to be coming from std::locale(""). Which is weird because that should be supported.

@marcows marcows mentioned this pull request Nov 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Many distracting compile warnings with GCC

4 participants