Re: [PATCH] C++ breaks on linux/ioport.h

From: Paul Barton-Davis (pbd@Op.Net)
Date: Thu Apr 27 2000 - 10:19:07 EST


>> >From: Jes Sorensen <Jes.Sorensen@cern.ch>
>>
>> >Thats pretty irrelevant, you are not supposed to include the kernel
>> >headers in C++ programs.
>>
>> I find this approach pretty worrying. Its *often* necessary to include
>> such files in user-space programs that use ioctl to control various
>> hardware resourcs (e.g. linux/rtc.h).
>
>hey, I am sure Jes was joking, just forgot to put a smiley there :)

I hope so. Sorry if I failed to pick up on the obvious clues :)

>Of course, one can include anything he likes anywhere he likes - but to
>prevent compilation failures the headers protect some stuff with
>__KERNEL__ and if the program *really* wants to access that stuff (e.g.
>some readers of /dev/kmem etc.) they can define __KERNEL__ and then deal
>with the problems internally, i.e. it becomes app programmer's problem to
>arrange the headers correctly and not a kernel header writer's problem.

Thats not the issue here. The issue is using the keyword "new" for a
declaration's argument. It would be nice if this was avoided, just
like "delete", "catch", "throw" and the rest of the C++ keyword superset.

If the relevant declaration is inside __KERNEL__ and so are some
constants that user-space needs, the programmer is out of luck if
these keywords are used in the declarations.

--p

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:13 EST