Thread: warning C4509: nonstandard extension used: 'a' uses SEH and 'b' has destructor

  1. #1
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545

    warning C4509: nonstandard extension used: 'a' uses SEH and 'b' has destructor

    Hi,
    I'm getting some of these warnings:
    Code:
    warning C4509: nonstandard extension used: 'a' uses SEH and 'b' has destructor
    The function uses calls to RpcTryExcept, RpcExcept, RpcEndExcept... but I need to use a RAII object in the function. I have no idea if or why those SEH functions are needed since I didn't write it, so I'd rather not remove them. Can I make SEH and RAII live together happily?

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Hmm.
    Well, all I can tell is that they don't work together:
    You should not use structured exception handling in functions that use objects with destructors. If an exception occurs, the destructor cannot be called. Use C++ exception handling instead.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed