Run Microsoft Analyzer over dmd source code

KennyTM~ kennytm at gmail.com
Sun Aug 7 12:08:35 PDT 2011


On Aug 8, 11 02:45, bearophile wrote:
> Vladimir Panteleev:
>
>> http://thecybershadow.net/d/vcanalysis/
>
> As with (first report of) Clang I see that assert(p); p->foo... are marked as "Dereferencing NULL pointer".
>
>
> Do you know the purpose of this?
>        os->name = strdup(name);
> warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details. c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string.h(238) : see declaration of 'strdup'
>

http://stackoverflow.com/questions/14386/fopen-deprecated-warning

>
> And do you know what kind of troubles this warning helps to avoid?
> c:\projects\extern\d\dmd\src\root\dchar.h(164): warning C6328: 'char' passed as parameter '1' when 'unsigned char' is required in call to 'isalpha'
>

You could search the error code in Google to get the info in MSDN.

http://msdn.microsoft.com/en-us/library/ms245348%28v=VS.100%29.aspx:

"For routines starting with is*, passing an argument of type char might 
yield unpredictable results. For example, an SBCS or MBCS single-byte 
character of type char with a value greater than 0x7F is negative. If a 
char is passed, the compiler might convert the value to a signed int or 
a signed long. This value could be sign-extended by the compiler, with 
unexpected results."

> Bye,
> bearophile



More information about the Digitalmars-d mailing list