Microsoft MIDL не сообщает об ошибке, если typedef использует неизвестный тип, это ошибка? - PullRequest
0 голосов
/ 15 ноября 2008

Хотелось бы узнать, что я что-то упускаю:

//this is test.idl
typedef foo foo_t;
// end of test.idl

Когда я компилирую test.idl с помощью следующей команды:

midl /W4 test.idl

Я получаю этот вывод

Microsoft (R) 32b/64b MIDL Compiler Version 6.00.0366
Copyright (c) Microsoft Corporation 1991-2002. All rights reserved.
Processing .\test.idl
test.idl

и я получаю неправильный файл test.h (внизу этого сообщения), в котором только

typedef foo_t;

где неизвестный тип foo был молча отброшен.

Я бы ожидал сообщение об ошибке "foo is unknown типа ", я не прав?

Нужно ли передавать какие-либо конкретные аргументы в команду MIDL?

Я получил тот же результат с версией компилятора MIDL 7.00.0500

/* this ALWAYS GENERATED file contains the definitions for the
interfaces */

 /* File created by MIDL compiler version 6.00.0366 */
/* at Thu Nov 13 11:47:40 2008
 */
/* Compiler settings for test.idl:
    Oicf, W4, Zp8, env=Win32 (32b run)
    protocol : dce , ms_ext, c_ext, robust
    error checks: allocation ref bounds_check enum stub_data
    VC __declspec() decoration level:
         __declspec(uuid()), __declspec(selectany), __declspec
(novtable)
         DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING(  )

#pragma warning( disable: 4049 )  /* more than 64k source lines */

/* verify that the <rpcndr.h> version is high enough to compile this
file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif

#include "rpc.h"
#include "rpcndr.h"

#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__

#ifndef __test_h__
#define __test_h__

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

/* Forward Declarations */

#ifdef __cplusplus
extern "C"{
#endif

void * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void * );

/* interface __MIDL_itf_test_0000 */
/* [local] */

typedef foo_t;

extern RPC_IF_HANDLE __MIDL_itf_test_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_test_0000_v0_0_s_ifspec;

/* Additional Prototypes for ALL interfaces */

/* end of Additional Prototypes */

#ifdef __cplusplus
}

#endif

#endif 

1 Ответ

0 голосов
/ 18 ноября 2008
...