You are not logged in.

Read the FAQ and Knowledge Base before posting.
We won't make a 3DS/2DS emulator.



#1 2007-05-14 09:23:27

Delantero®
Member
Registered: 2007-05-14
Posts: 5

Warnings in desmume build

When i complete the compile of desmume cvs, the log show three warnings:

------ Build started: Project: DeSmuME, Configuration: Debug Win32 ------
Compiling...
wifi.c
tileView.c
thumb_instructions.c
SPU.c
snddx.c
saves.c
ROMReader.c
render3D.c
palView.c
OGLRender.c
oamView.c
NDSSystem.c
c:\downloads\desmume\src\ndssystem.c(202) : warning C4996: 'strdup' was declared deprecated
        c:\program files\microsoft visual studio 8\vc\include\string.h(205) : see declaration of 'strdup'
        Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details.'

MMU.c
memView.c
mc.c
c:\downloads\desmume\src\mc.c(190) : warning C4047: '=' : 'char *' differs in levels of indirection from 'int'

matrix.c
mapView.c
main.c
IORegView.c
GPU.c
Generating Code...
Compiling...
ginfo.c
fs-windows.c
FirmConfig.c
FIFO.c
disView.c
Disassembler.c
debug.c
c:\downloads\desmume\src\debug.c(36) : warning C4996: 'strdup' was declared deprecated
        c:\program files\microsoft visual studio 8\vc\include\string.h(205) : see declaration of 'strdup'
        Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details.'

CWindow.c
cp15.c
ConfigKeys.c
cflash.c
bios.c
armcpu.c
arm_instructions.c
Generating Code...
Build log was saved at "file://c:\Downloads\desmume\src\windows\Debug\BuildLog.htm"
DeSmuME - 0 error(s), 3 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

The emulator runs, apparently, okay, but i wanted to know:

These warnings are nomal?
It's possible to solve these problems? How?
I can use the emulator without problems referring to they in future?

It's just this. Bye.

Offline

#2 2007-05-14 13:58:19

XTra KrazzY
Member
Registered: 2007-03-23
Posts: 108

Re: Warnings in desmume build

These warnings are pretty much normal.You need to switch to C mode in the project settings, though, or if you implemented some C++ stuff in it just replace all of the "strdup" instances to "_strdup".

This also occurs in strcpy, strcat and many other C++ deprecated string functions (strcpy_s, _sprintf, and so on are the "new" C++ conforming functions).

Hope it helps.


If you are reading this signature, you SERIOUSLY need to get a life.

Offline

#3 2007-05-15 06:02:43

Delantero®
Member
Registered: 2007-05-14
Posts: 5

Re: Warnings in desmume build

Okay. I fix the problem with strdup, but this:

mc.c
c:\downloads\desmume\src\mc.c(190) : warning C4047: '=' : 'char *' differs in levels of indirection from 'int'

How solve?

Offline

#4 2007-05-17 00:57:07

Delantero®
Member
Registered: 2007-05-14
Posts: 5

Re: Warnings in desmume build

Replies 2. Views 126.
Somebody there?

Offline

#5 2007-05-17 01:39:26

shash
Administrator
Registered: 2007-03-17
Posts: 897

Re: Warnings in desmume build

Why should you need to solve those warnings ?

Offline

#6 2007-05-17 05:40:08

Delantero®
Member
Registered: 2007-05-14
Posts: 5

Re: Warnings in desmume build

Shash
   
What I wanted to know is if these warnings can generate errors in the emulator in the future. They can?

Offline

#7 2007-05-17 10:00:42

masscat
Member
From: UK
Registered: 2007-03-17
Posts: 73
Website

Re: Warnings in desmume build

The warning C4047 is because the header file string.h has not been included at the top of the mc.c file. Therefore there is no prototype for the strdup function so Visual C++ makes one up. This is a bit naughty and string.h should be included. If you do add #include <string.h> at the top of the file and you will get the same warning as the other two.

To remove the warning C4996: 'strdup' was declared deprecated warning is not quite as simple as replacing strdup with _strdup. The source files are used on all platforms and under Linux Desmume is compiled with a plain old C compiler so _strdup would not be understood. You could do something like:

#ifdef __cplusplus
#define STRDUP_FN _strdup
#else
#define STRDUP_FN strdup
#endif

and replace strdup with STRDUP_FN.

Offline

Board footer

Powered by FluxBB