336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
warning C4018: '>=' : signed 또는 unsigned가 일치하지 않습니다.

MSDN에서 설명하기를
대략 부호 있는 숫자와 부호 없는 숫자를 비교하려면 부호 있는 값을 부호 없는 값으로 변환해야 한다고한다.

즉, 두형식 중 하나를 캐스팅해서 해결이 가능하다고 한다.



1. warning C4018 발생코드

sInt adjust = newVA - oldVA;

if(adjust < 0)
{

newVA = oldVA;

if(newSize >= -adjust)

newSize += adjust;

}


2. 수정코드


int newSize2 = 0; //added
sInt adjust = newVA - oldVA;

if(adjust < 0)
{

newVA = oldVA;

newSize2 = newSize; //added

if(newSize2 >= -adjust) //modified

newSize += adjust;

}


'Common knowledge' 카테고리의 다른 글

Avira Cli Scan  (0) 2016.07.28
IP주소 정규식 패턴  (0) 2016.07.28
C++ warning C4996: 'mbstowcs' 해결  (0) 2016.07.26
C++ 클래스 변수 사용  (0) 2016.07.26
Ubuntu crontab 사용  (0) 2016.07.20
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

warning C4996: 'mbstowcs': This function or variable may be unsafe. Consider using mbstowcs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.


대략 mbstowcs 함수는 안전하지 않으니 mbstowcs_s 함수를 사용하라는거다.


수정 전
mbstowcs(wideFileName,fileName,260);


수정 후
size_t ConvertedChars = 0;
mbstowcs_s(&ConvertedChars,wideFileName,fileName,260);


위와 같이 소스를 수정하면 Warning이 발생하지 않는다.


또한, 아래와 같이 무시할 수 있지만 되도록이면 warning도 찾아서 위와같이 고쳐주자.
#pragma warning(disable:4996)



'Common knowledge' 카테고리의 다른 글

IP주소 정규식 패턴  (0) 2016.07.28
C++ warning C4018 해결  (0) 2016.07.26
C++ 클래스 변수 사용  (0) 2016.07.26
Ubuntu crontab 사용  (0) 2016.07.20
python 필수 모듈  (0) 2016.07.19
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

다운로드 : http://yasm.tortall.net/Download.html
 - Win32 VS2010.zip

파일명 변경 : vsyasm.exe > yasm.exe
복사 : C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\

파일명 변경 : vsyasm.props, vsyasm.targets, vsyasm.xml > yasm.props, yasm.targets, yasm.xml
복사 : C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\

도구 > 옵션 > 프로젝트 및 솔루션 > VC++ 프로젝트설정 > 빌드 사용자 지정 검색 경로에 아래 경로 입력
  - C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations


***실행파일명같은경우에는 .asm파일의 속성에서 사용자지정빌드도구에서 명령줄에서 수정이 가능하다.



Readme.txt

========================================================================

The YASM version vsyasm.exe is designed specifically for use
with Visual Studio 2010. To tell Visual Studio where to find
vsyasm.exe, the environment variable YASMPATH can be set to
the absolute path of the directory in which vsyasm.exe is
located (this path should include the final backslash).

Alternatively you can find the directory (or directories)
where the VC++ compiler binaries are located and put copies
of the vsyasm.exe binary in these directories. The typical
location on 64-bit Windows is:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin

On 32-bit Windows it is normally at:
 
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin

Depending on your system you can use either the win32 or the
x64 version of vsyasm.exe, which must be named vsyasm.exe.

To use the new custom tools facility in Visual Studio 2010, you
need to place a copy of three files - yasm.props, yasm.targets
and yasm.xml - into a location where they can be found by the
Visual Studio build customisation processes.  There are several
ways to do this:

  a. put these files in the MSBUILD customisation directory,
  which is typically at:

    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations
 
  or:
 
    C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations

  b. put them in a convenient location and set this path in the
     'Build Customisations Search Path' in the Visual Studio
     'Projects and Solutions|VC++ Project Settings' item in
     the 'Tools|Options' menu;

  c. put them in a convenient location and set this path in the
     'Build Customisation dialogue (discussed later).

To use YASM in a project, right click on the project in the Solution
Explorer and select 'Build Customisations..'. This will give you a
dialog box that allows you to select YASM as an assembler (note that
your assembler files need to have the extension '.asm').  If you have
used option c. above, you will need to let the dialogue find them
using the 'Find Existing' button below the dialogue.

To assemble a file with YASM, select the Property Page for the
file and the select 'Yasm Assembler' in the Tool dialog entry.
Then click 'Apply' and an additional property page entry will
appear and enable YASM settings to be established.
========================================================================

'Analysis > Assembly' 카테고리의 다른 글

LEA와 MOV의 차이점  (0) 2016.04.27

+ Recent posts