Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build regression on wxAnimation::GetFrame() #18725

Closed
wxtrac opened this issue Apr 12, 2020 · 3 comments
Closed

Build regression on wxAnimation::GetFrame() #18725

wxtrac opened this issue Apr 12, 2020 · 3 comments

Comments

@wxtrac
Copy link
Collaborator

@wxtrac wxtrac commented Apr 12, 2020

Issue migrated from trac ticket # 18725

component: GUI-all | priority: normal | resolution: fixed | keywords: build regression

2020-04-12 15:13:00: ettl.martin (Ettl Martin) created the issue


After updating to latest git-master 2197f9d, a build regression in wxAnimation::GetFrame appeared.

Example

#!c++
static void bar(const wxAnimation &a)
{
   const wxImage img = a.GetFrame(0);  
}

Adding this piece of code to the animation-sample from wxWidgets and attempt to compile it gives

#!bash
$ make -f makefile.unx 
`wx-config --cxx` -c -o anitest_anitest.o -I. `wx-config --cxxflags --unicode=yes --static=no --toolkit=gtk2 --version=3.1`   -MTanitest_anitest.o -MF`echo anitest_anitest.o | sed -e 's,\.o$,.d,'` -MD -MP anitest.cpp
anitest.cpp: In function ‘void bar(const wxAnimation&)’:
anitest.cpp:245:36: error: passing ‘const wxAnimation’ as ‘this’ argument discards qualifiers [-fpermissive]
  245 |    const wxImage img = a.GetFrame(0);
      |                                    ^
In file included from anitest.h:11,
                 from anitest.cpp:39:
/usr/local/include/wx-3.1/wx/animate.h:51:13: note:   in call to ‘wxImage wxAnimation::GetFrame(unsigned int)’
   51 |     wxImage GetFrame(unsigned int frame);
      |             ^~~~~~~~
make: *** [makefile.unx:94: anitest_anitest.o] Error 1

#!bash
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.2.1-9ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2) 

Please find attached a patch that adds this code to the animation sample.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Apr 12, 2020

2020-04-12 15:13:17: ettl.martin (Ettl Martin) uploaded file anitest.diff (0.5 KiB)

patch

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Apr 12, 2020

2020-04-12 16:36:22: @vadz changed status from new to confirmed

2020-04-12 16:36:22: @vadz commented

Thanks for noticing this, will fix in a moment.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Apr 12, 2020

2020-04-12 16:37:12: @vadz set resolution to fixed

2020-04-12 16:37:12: @vadz commented

In ed077e1:
Restore wxAnimation::GetFrame() constness

This got lost, almost surely accidentally, in 706c8e8 (Merge branch
'disable-native-animation', 2020-04-07), so just restore it now.

See #1768

Closes #18725.

2020-04-12 16:37:12: @vadz changed status from confirmed to closed

@wxtrac wxtrac closed this Apr 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant