Author Topic: Do we need to fix this build warning in wxScintilla  (Read 3982 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Do we need to fix this build warning in wxScintilla
« on: October 12, 2014, 10:54:51 am »
Code
[ 97.8%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -D__WX__ -DWINVER=0x0501 -DLINK_LEXERS -DSCI_LEXER -DWXMAKINGDLL_SCI -iquote.objs\include -I.objs\include -I. -IE:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\include -IE:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Isdk\wxscintilla\src\scintilla\include -Isdk\wxscintilla\src\scintilla\src -Isdk\wxscintilla\src\scintilla\lexlib -c sdk\wxscintilla\src\ScintillaWX.cpp -o .objs\sdk\wxscintilla\src\ScintillaWX.o
sdk\wxscintilla\src\ScintillaWX.cpp: In member function 'virtual void ScintillaWX::Paste()':
sdk\wxscintilla\src\ScintillaWX.cpp:632:10: warning: variable 'haveTextString' set but not used [-Wunused-but-set-variable]

Any comments?
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re:
« Reply #1 on: October 12, 2014, 08:17:24 pm »
I can't have a look at the moment but blindly I remember that in this method there are probably #defines for different platforms. So are you sure it's really unused?
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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re:
« Reply #2 on: October 12, 2014, 09:23:47 pm »
I can't have a look at the moment but blindly I remember that in this method there are probably #defines for different platforms. So are you sure it's really unused?
Yes it is (unused).
It is set to true if there is rect-data or normal text, but never used later in the function.
The only distinction is done between rect-data and normal data.

It first appeared in the scintilla 3.5.0-branch in svn r9893 ("* prepare branch for merge to trunk") .

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re:
« Reply #3 on: October 12, 2014, 09:52:48 pm »
Hmmm.... I can't remember what I had in mind with that... I'll have a look.
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