locked
warning C28253 and C28252 given but call stack not RRS feed

  • Question

  • when building and running a code analysis I have been given the warnings:

    Severity

    Code

    Description

    Project

    File

    Line

    Suppression State

    Warning

    C28253

    Inconsistent   annotation for 'strcpy': _Param_(1) has   'SAL_writableTo(elementCount(_String_length_(_Source)+1))' on this instance.   See <no file>(0).

    MyProject

    c:\program files   (x86)\windows kits\10\include\10.0.10240.0\ucrt\string.h

    130

    Active

    Warning

    C28252

    Inconsistent annotation   for 'strcpy': _Param_(1) has   'SAL_writableTo(elementCount(_String_length_(__formal(1,parameter1))+1))' on   the prior instance. See <no file>(0).

    MyProject

    c:\program files   (x86)\windows kits\10\include\10.0.10240.0\ucrt\string.h

    130

    Active

    but unfortunately it doesn't tell me where in my code the string.h function has been accessed and just states "See <no file>(0)". How can I get hold of the function calling:

    __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1 (char*, __RETURN_POLICY_DST, __EMPTY_DECLSPEC, strcpy,

      _Out_writes_z_(_String_length_(_Source) + 1), char, _Destination,

      _In_z_charconst*, _Source)

    which is the function at line 130 in string.h which is the root of the warning? Any ideas welcome.


    Carol Brickley

    Monday, February 5, 2018 4:52 PM

Answers

  • Hi cb12_,

    thanks for posting here.

    >>but unfortunately it doesn't tell me where in my code the string.h function has been accessed and just states "See <no file>(0)". How can I get hold of the function calling:

    __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1 (char*, __RETURN_POLICY_DST, __EMPTY_DECLSPEC, strcpy,

    _Out_writes_z_(_String_length_(_Source) + 1), char, _Destination,

      _In_z_charconst*, _Source)

    which is the function at line 130 in string.h which is the root of the warning? Any ideas welcome.

    Please provide more information about your code. Does it happen in release mode or debug mode?

    Here is a similar case which indicates it may be a issue of Code Analyze.

    https://stackoverflow.com/questions/39687448/visual-studio-2015-string-h-inconsistent-annotations

    Maybe you could update your vs to the latest version and try again.

    https://www.visualstudio.com/downloads/

    Best Regards,

    Baron Bi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by cb12__ Tuesday, February 6, 2018 2:05 PM
    Tuesday, February 6, 2018 8:59 AM

All replies

  • Hi cb12_,

    thanks for posting here.

    >>but unfortunately it doesn't tell me where in my code the string.h function has been accessed and just states "See <no file>(0)". How can I get hold of the function calling:

    __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1 (char*, __RETURN_POLICY_DST, __EMPTY_DECLSPEC, strcpy,

    _Out_writes_z_(_String_length_(_Source) + 1), char, _Destination,

      _In_z_charconst*, _Source)

    which is the function at line 130 in string.h which is the root of the warning? Any ideas welcome.

    Please provide more information about your code. Does it happen in release mode or debug mode?

    Here is a similar case which indicates it may be a issue of Code Analyze.

    https://stackoverflow.com/questions/39687448/visual-studio-2015-string-h-inconsistent-annotations

    Maybe you could update your vs to the latest version and try again.

    https://www.visualstudio.com/downloads/

    Best Regards,

    Baron Bi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by cb12__ Tuesday, February 6, 2018 2:05 PM
    Tuesday, February 6, 2018 8:59 AM
  • Thanks Baron. I found that post earlier. It looks like it is a known issue with VS2015 and I need Vs2015 so will just live with it. Many thanks
    Tuesday, February 6, 2018 2:05 PM