SDL2 (latest hg, as of this morning) error in my application

I’m running LUbuntu, here is my output from g++ -v

$ g++ -v

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: …/src/configure -v --with-pkgversion=‘Ubuntu/Linaro
4.7.2-2ubuntu1’ --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
–enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
–program-suffix=-4.7 --enable-shared --enable-linker-build-id
–with-system-zlib --libexecdir=/usr/lib --without-included-gettext
–enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
–libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
–enable-libstdcxx-debug --enable-libstdcxx-time=yes
–enable-gnu-unique-object --enable-plugin --enable-objc-gc
–disable-werror --with-arch-32=i686 --with-tune=generic
–enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
–target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)

When I build my application, I get the following error:

In file included from /usr/local/include/SDL2/SDL_main.h:25:0,

             from /usr/local/include/SDL2/SDL.h:66,
             from sdlapp.hpp:2,
             from sdlapp.cpp:2:

/usr/local/include/SDL2/SDL_stdinc.h: In function ?char*
SDL_strchr_inline(const char*, int)?:
/usr/local/include/SDL2/SDL_stdinc.h:515:88: error: invalid conversion
from ?const char*? to ?char*? [-fpermissive]
/usr/local/include/SDL2/SDL_stdinc.h: In function ?char*
SDL_strrchr_inline(const char*, int)?:
/usr/local/include/SDL2/SDL_stdinc.h:524:90: error: invalid conversion
from ?const char*? to ?char*? [-fpermissive]
/usr/local/include/SDL2/SDL_stdinc.h: In function ?char*
SDL_strstr_inline(const char*, const char*)?:
/usr/local/include/SDL2/SDL_stdinc.h:533:116: error: invalid conversion
from ?const char*? to ?char*? [-fpermissive]

Here is my build command:

g++ -g main.cpp sdlapp.cpp -lSDL2 -lSDL2main -o main

Did I do something silly, or was this something that is actually an error?

I built SDL2 by doing the following:

hg clone http://hg.libsdl.org/SDL SDL2

cd SDL2
./autoconf
mkdir build
cd build
…/configure
make
sudo make install

Everything built as expected, no notable errors or warnings.

Any ideas?
-Alex

An issue of C++ implementing its own versions of C functions for const-correctness.

Just cast the result of strchr using a simple C-style cast.

Example:

Code:

  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) { return strrchr(str, c); }
  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) { return (char *)strrchr(str, c); }

(the C++ “correct” way would be using const_cast; but C then you’ve got to create two versions of the functions, which is a fairly pointless endeavor).------------------------
Nate Fries

I noticed a lot of people were just having to install a pile of 32-bit
libraries to make SDL work properly, so I decided to switch to Ubuntu
32-bit…now I have a different problem:

/bin/bash …/build-scripts/updaterev.sh

/bin/bash ./libtool --mode=compile gcc -g -O3 -DUSING_GENERATED_CONFIG_H
-Iinclude -I…/include -mmmx -m3dnow -msse -fvisibility=hidden
-D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -MMD -MT build/SDL.lo -c
…/src/SDL.c -o build/SDL.lo
libtool: compile: gcc -g -O3 -DUSING_GENERATED_CONFIG_H -Iinclude
-I…/include -mmmx -m3dnow -msse -fvisibility=hidden -D_REENTRANT
-DHAVE_LINUX_VERSION_H -Wall -MMD -MT build/SDL.lo -c …/src/SDL.c -fPIC
-DPIC -o build/.libs/SDL.o
In file included from …/include/SDL_main.h:25:0,
from …/include/SDL.h:66,
from …/src/SDL.c:25:
…/include/SDL_stdinc.h: In function ‘SDL_memcpy4’:
…/include/SDL_stdinc.h:429:16: error: ‘len’ undeclared (first use in this
function)
…/include/SDL_stdinc.h:429:16: note: each undeclared identifier is
reported only once for each function it appears in
make: *** [build/SDL.lo] Error 1

Peeked at the code, SDL_stdinc.h, starting at line 415:

SDL_FORCE_INLINE void *SDL_memcpy4(void *dst, const void *src, size_t

dwords)
{
#if defined(MACOSX)
/* We can count on memcpy existing on Mac OS X and being well-tuned. /
return memcpy(dst, src, dwords * 4);
#elif defined(GNUC) && defined(i386)
/
!!! FIXME: does this really beat memcpy() on any modern platform?
/
/
!!! FIXME: shouldn’t we just force the inputs to ecx/edi/esi
instead of this tapdance with outputs? /
/
!!! FIXME: amd64? */
int ecx, edi, esi;
asm volatile (
“cld \n\t”
“rep ; movsl \n\t”
: “=&c” (ecx), “=&D” (edi), “=&S” (esi)
: “0” (SDL_static_cast(unsigned, len)), “1” (dst), “2” (src)
: “memory”
);
return dst;
#else
return SDL_memcpy(dst, src, dwords * 4);
#endif
}

It appears that line 429 tries to access a variable “len” when one hasn’t
been declared.

Ryan, there is a good possiblity you accidentally broke it last push.

-AlexOn Fri, Mar 15, 2013 at 1:08 PM, Nathaniel J Fries wrote:

**
An issue of C++ implementing its own versions of C functions for
const-correctness.

Just cast the result of strchr using a simple C-style cast.

Example:

Code:

  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) {
    return strrchr(str, c); }
  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) {
    return (char *)strrchr(str, c); }

(the C++ “correct” way would be using const_cast; but C then you’ve got to
create two versions of the functions, which is a fairly pointless endeavor).


Nate Fries


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Fixed, thanks!On Fri, Mar 15, 2013 at 10:08 AM, Nathaniel J Fries wrote:

**
An issue of C++ implementing its own versions of C functions for
const-correctness.

Just cast the result of strchr using a simple C-style cast.

Example:

Code:

  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) {
    return strrchr(str, c); }
  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) {
    return (char *)strrchr(str, c); }

(the C++ “correct” way would be using const_cast; but C then you’ve got to
create two versions of the functions, which is a fairly pointless endeavor).


Nate Fries


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Fixed!On Fri, Mar 15, 2013 at 11:51 AM, Alex Barry <alex.barry at gmail.com> wrote:

I noticed a lot of people were just having to install a pile of 32-bit
libraries to make SDL work properly, so I decided to switch to Ubuntu
32-bit…now I have a different problem:

/bin/bash …/build-scripts/updaterev.sh

/bin/bash ./libtool --mode=compile gcc -g -O3 -DUSING_GENERATED_CONFIG_H
-Iinclude -I…/include -mmmx -m3dnow -msse -fvisibility=hidden
-D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -MMD -MT build/SDL.lo -c
…/src/SDL.c -o build/SDL.lo
libtool: compile: gcc -g -O3 -DUSING_GENERATED_CONFIG_H -Iinclude
-I…/include -mmmx -m3dnow -msse -fvisibility=hidden -D_REENTRANT
-DHAVE_LINUX_VERSION_H -Wall -MMD -MT build/SDL.lo -c …/src/SDL.c -fPIC
-DPIC -o build/.libs/SDL.o
In file included from …/include/SDL_main.h:25:0,
from …/include/SDL.h:66,
from …/src/SDL.c:25:
…/include/SDL_stdinc.h: In function ‘SDL_memcpy4’:
…/include/SDL_stdinc.h:429:16: error: ‘len’ undeclared (first use in
this function)
…/include/SDL_stdinc.h:429:16: note: each undeclared identifier is
reported only once for each function it appears in
make: *** [build/SDL.lo] Error 1

Peeked at the code, SDL_stdinc.h, starting at line 415:

SDL_FORCE_INLINE void *SDL_memcpy4(void *dst, const void *src, size_t

dwords)
{
#if defined(MACOSX)
/* We can count on memcpy existing on Mac OS X and being well-tuned.
/
return memcpy(dst, src, dwords * 4);
#elif defined(GNUC) && defined(i386)
/
!!! FIXME: does this really beat memcpy() on any modern
platform? /
/
!!! FIXME: shouldn’t we just force the inputs to ecx/edi/esi
instead of this tapdance with outputs? /
/
!!! FIXME: amd64? */
int ecx, edi, esi;
asm volatile (
“cld \n\t”
“rep ; movsl \n\t”
: “=&c” (ecx), “=&D” (edi), “=&S” (esi)
: “0” (SDL_static_cast(unsigned, len)), “1” (dst), “2” (src)
: “memory”
);
return dst;
#else
return SDL_memcpy(dst, src, dwords * 4);
#endif
}

It appears that line 429 tries to access a variable “len” when one hasn’t
been declared.

Ryan, there is a good possiblity you accidentally broke it last push.

-Alex

On Fri, Mar 15, 2013 at 1:08 PM, Nathaniel J Fries wrote:

**
An issue of C++ implementing its own versions of C functions for
const-correctness.

Just cast the result of strchr using a simple C-style cast.

Example:

Code:

  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) {
    return strrchr(str, c); }
  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) {
    return (char *)strrchr(str, c); }

(the C++ “correct” way would be using const_cast; but C then you’ve got
to create two versions of the functions, which is a fairly pointless
endeavor).


Nate Fries


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thanks for the quick fixes Sam, I thought I forgot how to Linux :POn Fri, Mar 15, 2013 at 2:58 PM, Sam Lantinga wrote:

Fixed!

On Fri, Mar 15, 2013 at 11:51 AM, Alex Barry <@Alex_Barry> wrote:

I noticed a lot of people were just having to install a pile of 32-bit
libraries to make SDL work properly, so I decided to switch to Ubuntu
32-bit…now I have a different problem:

/bin/bash …/build-scripts/updaterev.sh

/bin/bash ./libtool --mode=compile gcc -g -O3 -DUSING_GENERATED_CONFIG_H
-Iinclude -I…/include -mmmx -m3dnow -msse -fvisibility=hidden
-D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -MMD -MT build/SDL.lo -c
…/src/SDL.c -o build/SDL.lo
libtool: compile: gcc -g -O3 -DUSING_GENERATED_CONFIG_H -Iinclude
-I…/include -mmmx -m3dnow -msse -fvisibility=hidden -D_REENTRANT
-DHAVE_LINUX_VERSION_H -Wall -MMD -MT build/SDL.lo -c …/src/SDL.c -fPIC
-DPIC -o build/.libs/SDL.o
In file included from …/include/SDL_main.h:25:0,
from …/include/SDL.h:66,
from …/src/SDL.c:25:
…/include/SDL_stdinc.h: In function ‘SDL_memcpy4’:
…/include/SDL_stdinc.h:429:16: error: ‘len’ undeclared (first use in
this function)
…/include/SDL_stdinc.h:429:16: note: each undeclared identifier is
reported only once for each function it appears in
make: *** [build/SDL.lo] Error 1

Peeked at the code, SDL_stdinc.h, starting at line 415:

SDL_FORCE_INLINE void *SDL_memcpy4(void *dst, const void *src, size_t

dwords)
{
#if defined(MACOSX)
/* We can count on memcpy existing on Mac OS X and being well-tuned.
/
return memcpy(dst, src, dwords * 4);
#elif defined(GNUC) && defined(i386)
/
!!! FIXME: does this really beat memcpy() on any modern
platform? /
/
!!! FIXME: shouldn’t we just force the inputs to ecx/edi/esi
instead of this tapdance with outputs? /
/
!!! FIXME: amd64? */
int ecx, edi, esi;
asm volatile (
“cld \n\t”
“rep ; movsl \n\t”
: “=&c” (ecx), “=&D” (edi), “=&S” (esi)
: “0” (SDL_static_cast(unsigned, len)), “1” (dst), “2” (src)
: “memory”
);
return dst;
#else
return SDL_memcpy(dst, src, dwords * 4);
#endif
}

It appears that line 429 tries to access a variable “len” when one hasn’t
been declared.

Ryan, there is a good possiblity you accidentally broke it last push.

-Alex

On Fri, Mar 15, 2013 at 1:08 PM, Nathaniel J Fries wrote:

**
An issue of C++ implementing its own versions of C functions for
const-correctness.

Just cast the result of strchr using a simple C-style cast.

Example:

Code:

  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) {
    return strrchr(str, c); }
  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) {
    return (char *)strrchr(str, c); }

(the C++ “correct” way would be using const_cast; but C then you’ve got
to create two versions of the functions, which is a fairly pointless
endeavor).


Nate Fries


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Whoops, buildbot is hung up, so it never tested if this was broken; sorry!

–ryan.On Mar 15, 2013, at 2:51 PM, Alex Barry <alex.barry at gmail.com> wrote:

I noticed a lot of people were just having to install a pile of 32-bit libraries to make SDL work properly, so I decided to switch to Ubuntu 32-bit…now I have a different problem:

/bin/bash …/build-scripts/updaterev.sh
/bin/bash ./libtool --mode=compile gcc -g -O3 -DUSING_GENERATED_CONFIG_H -Iinclude -I…/include -mmmx -m3dnow -msse -fvisibility=hidden -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -MMD -MT build/SDL.lo -c …/src/SDL.c -o build/SDL.lo
libtool: compile: gcc -g -O3 -DUSING_GENERATED_CONFIG_H -Iinclude -I…/include -mmmx -m3dnow -msse -fvisibility=hidden -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -MMD -MT build/SDL.lo -c …/src/SDL.c -fPIC -DPIC -o build/.libs/SDL.o
In file included from …/include/SDL_main.h:25:0,
from …/include/SDL.h:66,
from …/src/SDL.c:25:
…/include/SDL_stdinc.h: In function ‘SDL_memcpy4’:
…/include/SDL_stdinc.h:429:16: error: ‘len’ undeclared (first use in this function)
…/include/SDL_stdinc.h:429:16: note: each undeclared identifier is reported only once for each function it appears in
make: *** [build/SDL.lo] Error 1

Peeked at the code, SDL_stdinc.h, starting at line 415:

SDL_FORCE_INLINE void *SDL_memcpy4(void *dst, const void src, size_t dwords)
{
#if defined(MACOSX)
/
We can count on memcpy existing on Mac OS X and being well-tuned. /
return memcpy(dst, src, dwords * 4);
#elif defined(GNUC) && defined(i386)
/
!!! FIXME: does this really beat memcpy() on any modern platform? /
/
!!! FIXME: shouldn’t we just force the inputs to ecx/edi/esi instead of this tapdance with outputs? /
/
!!! FIXME: amd64? */
int ecx, edi, esi;
asm volatile (
“cld \n\t”
“rep ; movsl \n\t”
: “=&c” (ecx), “=&D” (edi), “=&S” (esi)
: “0” (SDL_static_cast(unsigned, len)), “1” (dst), “2” (src)
: “memory”
);
return dst;
#else
return SDL_memcpy(dst, src, dwords * 4);
#endif
}

It appears that line 429 tries to access a variable “len” when one hasn’t been declared.

Ryan, there is a good possiblity you accidentally broke it last push.

-Alex

On Fri, Mar 15, 2013 at 1:08 PM, Nathaniel J Fries wrote:

An issue of C++ implementing its own versions of C functions for const-correctness.

Just cast the result of strchr using a simple C-style cast.

Example:

Code:

  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) { return strrchr(str, c); }
  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) { return (char *)strrchr(str, c); }

(the C++ “correct” way would be using const_cast; but C then you’ve got to create two versions of the functions, which is a fairly pointless endeavor).

Nate Fries


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

No worries mate, I also saw that buildbot was bunged up, so I figured you
wouldn’t have caught it. Again, thanks to both of you for the quick fix :)On Fri, Mar 15, 2013 at 4:02 PM, Ryan C. Gordon wrote:

Whoops, buildbot is hung up, so it never tested if this was broken; sorry!

–ryan.

On Mar 15, 2013, at 2:51 PM, Alex Barry <@Alex_Barry> wrote:

I noticed a lot of people were just having to install a pile of 32-bit
libraries to make SDL work properly, so I decided to switch to Ubuntu
32-bit…now I have a different problem:

/bin/bash …/build-scripts/updaterev.sh

/bin/bash ./libtool --mode=compile gcc -g -O3 -DUSING_GENERATED_CONFIG_H
-Iinclude -I…/include -mmmx -m3dnow -msse -fvisibility=hidden
-D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -MMD -MT build/SDL.lo -c
…/src/SDL.c -o build/SDL.lo
libtool: compile: gcc -g -O3 -DUSING_GENERATED_CONFIG_H -Iinclude
-I…/include -mmmx -m3dnow -msse -fvisibility=hidden -D_REENTRANT
-DHAVE_LINUX_VERSION_H -Wall -MMD -MT build/SDL.lo -c …/src/SDL.c -fPIC
-DPIC -o build/.libs/SDL.o
In file included from …/include/SDL_main.h:25:0,
from …/include/SDL.h:66,
from …/src/SDL.c:25:
…/include/SDL_stdinc.h: In function ‘SDL_memcpy4’:
…/include/SDL_stdinc.h:429:16: error: ‘len’ undeclared (first use in
this function)
…/include/SDL_stdinc.h:429:16: note: each undeclared identifier is
reported only once for each function it appears in
make: *** [build/SDL.lo] Error 1

Peeked at the code, SDL_stdinc.h, starting at line 415:

SDL_FORCE_INLINE void *SDL_memcpy4(void *dst, const void *src, size_t

dwords)
{
#if defined(MACOSX)
/* We can count on memcpy existing on Mac OS X and being well-tuned.
/
return memcpy(dst, src, dwords * 4);
#elif defined(GNUC) && defined(i386)
/
!!! FIXME: does this really beat memcpy() on any modern
platform? /
/
!!! FIXME: shouldn’t we just force the inputs to ecx/edi/esi
instead of this tapdance with outputs? /
/
!!! FIXME: amd64? */
int ecx, edi, esi;
asm volatile (
“cld \n\t”
“rep ; movsl \n\t”
: “=&c” (ecx), “=&D” (edi), “=&S” (esi)
: “0” (SDL_static_cast(unsigned, len)), “1” (dst), “2” (src)
: “memory”
);
return dst;
#else
return SDL_memcpy(dst, src, dwords * 4);
#endif
}

It appears that line 429 tries to access a variable “len” when one hasn’t
been declared.

Ryan, there is a good possiblity you accidentally broke it last push.

-Alex

On Fri, Mar 15, 2013 at 1:08 PM, Nathaniel J Fries wrote:

**
An issue of C++ implementing its own versions of C functions for
const-correctness.

Just cast the result of strchr using a simple C-style cast.

Example:

Code:

  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) {
    return strrchr(str, c); }
  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) {
    return (char *)strrchr(str, c); }

(the C++ “correct” way would be using const_cast; but C then you’ve got
to create two versions of the functions, which is a fairly pointless
endeavor).


Nate Fries


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

No problem! :)On Fri, Mar 15, 2013 at 1:09 PM, Alex Barry <alex.barry at gmail.com> wrote:

No worries mate, I also saw that buildbot was bunged up, so I figured you
wouldn’t have caught it. Again, thanks to both of you for the quick fix :slight_smile:

On Fri, Mar 15, 2013 at 4:02 PM, Ryan C. Gordon wrote:

Whoops, buildbot is hung up, so it never tested if this was broken; sorry!

–ryan.

On Mar 15, 2013, at 2:51 PM, Alex Barry <alex.barry at gmail.com> wrote:

I noticed a lot of people were just having to install a pile of 32-bit
libraries to make SDL work properly, so I decided to switch to Ubuntu
32-bit…now I have a different problem:

/bin/bash …/build-scripts/updaterev.sh

/bin/bash ./libtool --mode=compile gcc -g -O3 -DUSING_GENERATED_CONFIG_H
-Iinclude -I…/include -mmmx -m3dnow -msse -fvisibility=hidden
-D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -MMD -MT build/SDL.lo -c
…/src/SDL.c -o build/SDL.lo
libtool: compile: gcc -g -O3 -DUSING_GENERATED_CONFIG_H -Iinclude
-I…/include -mmmx -m3dnow -msse -fvisibility=hidden -D_REENTRANT
-DHAVE_LINUX_VERSION_H -Wall -MMD -MT build/SDL.lo -c …/src/SDL.c -fPIC
-DPIC -o build/.libs/SDL.o
In file included from …/include/SDL_main.h:25:0,
from …/include/SDL.h:66,
from …/src/SDL.c:25:
…/include/SDL_stdinc.h: In function ‘SDL_memcpy4’:
…/include/SDL_stdinc.h:429:16: error: ‘len’ undeclared (first use in
this function)
…/include/SDL_stdinc.h:429:16: note: each undeclared identifier is
reported only once for each function it appears in
make: *** [build/SDL.lo] Error 1

Peeked at the code, SDL_stdinc.h, starting at line 415:

SDL_FORCE_INLINE void *SDL_memcpy4(void *dst, const void *src, size_t

dwords)
{
#if defined(MACOSX)
/* We can count on memcpy existing on Mac OS X and being well-tuned.
/
return memcpy(dst, src, dwords * 4);
#elif defined(GNUC) && defined(i386)
/
!!! FIXME: does this really beat memcpy() on any modern
platform? /
/
!!! FIXME: shouldn’t we just force the inputs to ecx/edi/esi
instead of this tapdance with outputs? /
/
!!! FIXME: amd64? */
int ecx, edi, esi;
asm volatile (
“cld \n\t”
“rep ; movsl \n\t”
: “=&c” (ecx), “=&D” (edi), “=&S” (esi)
: “0” (SDL_static_cast(unsigned, len)), “1” (dst), “2” (src)
: “memory”
);
return dst;
#else
return SDL_memcpy(dst, src, dwords * 4);
#endif
}

It appears that line 429 tries to access a variable “len” when one hasn’t
been declared.

Ryan, there is a good possiblity you accidentally broke it last push.

-Alex

On Fri, Mar 15, 2013 at 1:08 PM, Nathaniel J Fries wrote:

**
An issue of C++ implementing its own versions of C functions for
const-correctness.

Just cast the result of strchr using a simple C-style cast.

Example:

Code:

  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) {
    return strrchr(str, c); }
  • SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) {
    return (char *)strrchr(str, c); }

(the C++ “correct” way would be using const_cast; but C then you’ve got
to create two versions of the functions, which is a fairly pointless
endeavor).


Nate Fries


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org