From owner-freebsd-questions Thu Apr 12 10:53:45 2001 Delivered-To: freebsd-questions@freebsd.org Received: from Terry.Dorm8.NCTU.edu.tw (Terry.Dorm8.NCTU.edu.tw [140.113.93.99]) by hub.freebsd.org (Postfix) with ESMTP id 5B4F337B449 for ; Thu, 12 Apr 2001 10:53:42 -0700 (PDT) (envelope-from ijliao@Terry.Dorm8.NCTU.edu.tw) Received: (from ijliao@localhost) by Terry.Dorm8.NCTU.edu.tw (8.11.3/8.11.2) id f3CHs4J30961 for freebsd-questions@FreeBSD.ORG; Fri, 13 Apr 2001 01:54:05 +0800 (CST) (envelope-from ijliao) Date: Fri, 13 Apr 2001 01:54:04 +0800 From: Ying-Chieh Liao To: freebsd-questions@FreeBSD.ORG Subject: cast int to enum in C++ Message-ID: <20010413015404.A30645@terry.dragon2.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In C, compiling following code is all ok but in C++, there's some err msgs : test.cpp:12: conversion from `int' to `enum test' I've tried g++ -fenum-int-equiv test.cpp, but it said that this flag is no longer supported :< what can I do ? dont suggest me to change tmp(1) to tmp(TEST1) ... typedef enum { TEST1=1, TEST2=2, TEST3=3 } test; void tmp(test argv) { return; } int main(void) { tmp(1); } -- Allocate four digits for the year part of a date : a new millennium is coming. --- David Huber To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message