Sign in to follow this  

double includes of stdio.h

Recommended Posts

Hi.Sort of a noob question here, I was checking out about this program where the includes are given as follows. I was thinking that the strsafe.h is included first which itself has included stdio.h then why the stdio.h is included again. Its confusing me a bit.
#define STRICT
#define _CRT_SECURE_NO_DEPRECATE // Not recommended but need to support VS2003 and VS2005 for now
#include <windows.h>
#include <tchar.h>
#pragma warning( disable : 4996 ) // disable deprecated warning 
#include <strsafe.h>
#pragma warning( default : 4996 ) 
#pragma warning(disable:4005)
#pragma warning(default:4005)
#include <stdio.h>
#include <stdlib.h>
#include <commctrl.h>
#include <assert.h>
#pragma warning( push, 3 )
#pragma warning(disable:4995 4786 4788)
#include <vector>
#pragma warning( pop )
using namespace std;
#include "dxdiaginfo.h"
#include "resource.h"
#if defined(DEBUG) | defined(_DEBUG)
#include <crtdbg.h>

Share this post

Link to post
Share on other sites
strsafe provides certain functions if strsafe's job to provide a full stdio interface then the inclusion of stdio is redundant. However I don't believe this to be the case, and as such I would not rely on that behavior.

Share this post

Link to post
Share on other sites
Original post by SaurabhTorne
well in that case strsafe.h is not that safe!
But if future compatible system is required then probably the file is bound to be there.

That doesn't make strsafe.h unsafe. It provides safe versions of string manipulation routines.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this