Re: target_core_user.h in C++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2015-10-13 14:15, Andy Grover wrote:
On 10/13/2015 12:02 PM, Oleg Smolsky wrote:
On 2015-10-13 11:51, Andy Grover wrote:
On 10/13/2015 11:41 AM, Oleg Smolsky wrote:
On 2015-10-13 11:33, Bart Van Assche wrote:
On 10/13/2015 11:28 AM, Oleg Smolsky wrote:
-enum tcmu_opcode {
+enum tcmu_opcode
+#if defined(__cplusplus)
+        : __u32
+#endif
+{

Will this work with older C++ compilers ?

No, this is a C++11 thing. I've added an extra check.

I think any sort of C++ support in Linux's exported headers would be a
big policy shift, and very unlikely in the foreseeable future, I'm
afraid.

Well, that would be sad. I know Linus has been vocal about using C++
within the kernel source, yet here we are talking about user-mode apps
consuming the kernel API.

The C header files just define the exported kernel data structures, the ABI. It is safe for other languages to craft their own equivalent definitions outside the kernel tree because the ABI, once exported, should never change.

Of course, Andy. Yet that would essentially fork the spec and, thus, will become stale sooner or later. I would have to keep manually adding things in order to follow the kernel's evolution.

Obviously I am not going to propose adding C++ constructors to these structs, yet supporting C and C++ compilation from the single source would be very nice.

Oleg.
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux