Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Sep 2002 22:59:45 +0200 (CEST)
From:      Alexander Langer <alex@big.endian.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/43372: Broken struct ufs_args in ufsmount.h
Message-ID:  <200209252059.g8PKxjMs042714@fump.kawo2.rwth-aachen.de>

next in thread | raw e-mail | index | archive | help

>Number:         43372
>Category:       bin
>Synopsis:       Broken struct ufs_args in ufsmount.h
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 25 14:00:08 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Alexander Langer
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
none
>Environment:

FreeBSD FreeBSD 5.0-CURRENT #11: Wed Sep 11 16:45:23 CEST 2002 i386

>Description:

ufsmount.h is broken for C++.  It uses a reserved keyword "export"
for a member of the struct ufs_args:
struct ufs_args {
        char    *fspec;                 /* block special device to mount */
        struct  export_args export;     /* network export information */
};

alex@zerogravity ~ $ cat ufsmount.cc 
extern "C" {
#include <sys/param.h>
#include <sys/mount.h>
#include <ufs/ufs/ufsmount.h>
}
alex@zerogravity ~ $ c++ --version
c++ (GCC) 3.2.1 [FreeBSD] 20020901 (prerelease)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

alex@zerogravity ~ $ cc -c ufsmount.cc 
In file included from ufsmount.cc:4:
/usr/include/ufs/ufs/ufsmount.h:45: syntax error before `export'

>How-To-Repeat:

see above

>Fix:

As a workaround, you can #define export _export before you include
ufsmount.h, and undefine it later.  This is an ugly hack, but working
for certain uses.

A real fix is to proberly name the member of the struct.
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209252059.g8PKxjMs042714>