473,888 Members | 2,199 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Language standard: the least common denominator vs. utility

One thing that keeps coming up in this forum is that
standard C lacks many functions which are required in
a workstation or server but not possible in an embedded controller.
This results in a plethora of "don't ask here,
ask in comp.x.y instead", for queries on functions that from the
documentation available to the programmer appear to be part
of the C language. I think largely because of this "least common
denominator" C language standard we have POSIX, XPG4, etc, which
add these useful and in many instances necessary pieces. And this
multiplicity of standards can be a real pain. I would really rather
write code that complies with _ONE_ language standard than write code
that has to comply with _MANY_ interrelated language standards.

Just for the sake of argument, would it be so terribly wrong for the
ISO/ANSI C standard to define capabilities relevant for computers
other than dishwasher controllers? For instance, if the language
required the compiler define for the target platform these constants as
0 (not present) or 1 or higher (present, with number indicating various
future revision levels):

ISOC_CAPABILITY _MULTIUSER
ISOC_CAPABILITY _NETWORK_IPV4
ISOC_CAPABILITY _NETWORK_IPV6
ISOC_CAPABILITY _FILELOCKING
ISOC_CAPABILITY _INTERPROCESS
etc.

The code could test for these, and if present, utilize the relevant
supported functions. For instance, if MULTIUSER was defined then
some form of "getusernam e" would be supported.

Note that this is more or less what compilers do now, except that the
constants refer to POSIX, XPG4, etc, and it is not so much including by
capability, but including by language extension, with the latter rarely
clearly associated with the former. This results in insanely messy
compiler provided include files in which it is often painful to trace
through the logic to determine which combination of posix,xpg4,ansi etc
must be set at compile time to obtain the desired functions.

For those purists who work on embedded controllers the potential
availability of these extra functions should pose no problem whatsoever.
They are perfectly free NOT to use them. The cross compiler would
negate these constants so that any code that accidentally tried to
use a function not supported on the target platform would be flagged at
compile time.

Regards,

David Mathog
Oct 19 '06 #1
22 2523
David Mathog wrote:
One thing that keeps coming up in this forum is that
standard C lacks many functions which are required in
a workstation or server but not possible in an embedded controller. This
results in a plethora of "don't ask here,
ask in comp.x.y instead", for queries on functions that from the
documentation available to the programmer appear to be part
of the C language. I think largely because of this "least common
denominator" C language standard we have POSIX, XPG4, etc, which
add these useful and in many instances necessary pieces. And this
multiplicity of standards can be a real pain. I would really rather
write code that complies with _ONE_ language standard than write code
that has to comply with _MANY_ interrelated language standards.

Just for the sake of argument, would it be so terribly wrong for the
ISO/ANSI C standard to define capabilities relevant for computers
other than dishwasher controllers? For instance, if the language
required the compiler define for the target platform these constants as
0 (not present) or 1 or higher (present, with number indicating various
future revision levels):
[...]
This exact discussion seems to pop up in reference to a great number of
languages that are common in the embedded world. For example, when
Forth was standardized there was a lot of discussion about the sorts of
capabilities various platforms could provide, and how much of that would
be included in the standard.

They ended up defining a "core" standard with many specific optional
capabilities. A conforming Forth implementation just has to satisfy the
core requirements and state which of the optional capabilities it supports.

So, this sort of thing has been adopted in other languages. I'm not
familiar enough with the ISO C standard to comment on whether there are
similar situations there.
Oct 19 '06 #2
In article <eh**********@n aig.caltech.edu >
David Mathog <ma****@caltech .eduwrote:
>Just for the sake of argument, would it be so terribly wrong for the
ISO/ANSI C standard to define capabilities relevant for computers
other than dishwasher controllers? For instance, if the language
required the compiler define for the target platform these constants as
0 (not present) or 1 or higher (present, with number indicating various
future revision levels):

ISOC_CAPABILIT Y_MULTIUSER
ISOC_CAPABILIT Y_NETWORK_IPV4
ISOC_CAPABILIT Y_NETWORK_IPV6
ISOC_CAPABILIT Y_FILELOCKING
ISOC_CAPABILIT Y_INTERPROCESS
etc.

The code could test for these, and if present, utilize the relevant
supported functions. For instance, if MULTIUSER was defined then
some form of "getusernam e" would be supported.
This sort of thing has been done in other language standards.

The result generally seems to be:

a) the "core" language standard is not as good, because the
standardizing-group spent a fair bit of effort on the
"peripheral " parts and had little time left over for the
"core" part.

b) the "peripheral " parts *really* stink. :-)

Functionally, there is no real difference between this and what we
have now:
>Note that this is more or less what compilers do now, except that the
constants refer to POSIX, XPG4, etc, and it is not so much including by
capability, but including by language extension, with the latter rarely
clearly associated with the former. This results in insanely messy
compiler provided include files in which it is often painful to trace
through the logic to determine which combination of posix,xpg4,ansi etc
must be set at compile time to obtain the desired functions.
.... except that, in the "now" case, when ISO C conflicts with POSIX,
it is pretty clear which one you *should* get when you select "ISO
C" or "POSIX". It may not be obvious *how* to do it, but at least
the Standard-forming groups are independent and hence (at least
logically speaking) more accountable.
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Oct 19 '06 #3
In article <eh**********@n aig.caltech.edu >,
David Mathog <ma****@caltech .eduwrote:
>Just for the sake of argument, would it be so terribly wrong for the
ISO/ANSI C standard to define capabilities relevant for computers
other than dishwasher controllers? For instance, if the language
required the compiler define for the target platform these constants as
0 (not present) or 1 or higher (present, with number indicating various
future revision levels):
>ISOC_CAPABILIT Y_MULTIUSER
ISOC_CAPABILIT Y_NETWORK_IPV4
ISOC_CAPABILIT Y_NETWORK_IPV6
ISOC_CAPABILIT Y_FILELOCKING
ISOC_CAPABILIT Y_INTERPROCESS
etc.
>The code could test for these, and if present, utilize the relevant
supported functions. For instance, if MULTIUSER was defined then
some form of "getusernam e" would be supported.
Looking at that -particular- list, I notice some semantic difficulties.

The Unix OS I'm using at the moment has IPv6 capabilities, but
we haven't configured any IPv6 interfaces (or infrastructure) .
Theoretically, by the time we run the binary, we might have -- or we
might want the binary to be usable on other systems with exactly the
same OS which might happen to have IPv6 interfaces configured.

Thus, any capabilities need to semantically distinguish between,
"the system knows about this family of functions and structures
and can compile and link with them" versus "this is enabled on the
system the binary is running on right now".

Similarily, although my OS supports IPv6, I might know that within
the effective lifetime of the binary, that we will not run it on
any system with IPv6 actually configured: therefore, there should
be available a corresponding series of overrides to say "don't use
this feature even though the system supports it".
Secondly, the standardization processes always like to see an
example implementation (to prove that it can be done without a lot
of trouble), and like to see that the example implementation has
actually been successfully used. I would thus propose that instead
of starting at the standardization level, that an autoconfig library
be built up, of standardized ways to probe for a feature, and
standardized feature naming conventions.

Imagine, for example, a facility sort of like CPAN (Comprehensive Perl
Archive Network), with an interface that allowed one to easily search
for a particular feature test and load the test structure in, and then
"include" that in one's automake configuration file for any particular
project. Like CPAN, there should be "versions" of the feature test
available and a mechanism to be notified of new versions; and there
should be major and minor components to the version number (major
number changes indicating backwards incompatabiliti es in the list of
names defined). And as successful probes for one feature might depend
upon successful probes for another feature, the probe scripts should
have the equivilent of perl's "require" -- i.e., run such and such a
feature test if you haven't already done so. Also, feature tests could
end up interrelated, so you would want dependancy checking against your
"installed" feature tests... and if the feature test you'd like to
load down relies upon something you haven't already loaded in (or need
a newer version of), you'd like the option of automatically installing
the missing or newer versions.

This is a project that could be done "de facto" -- a bunch of
people could just get together and Make It Happen.

If you were *really* ambitious, you could try a "Unified" library of
common routines -- code that already had all the system dependancies
built in, in order to accomplish the required tasks that were beyond
the facilities provided by Standard C, together with the infrastructure
such as described above to detect and load in new versions.
(Anything like that -might- perhaps best be done in terms of opaque
types.) But you could probably bog yourself down just in deciding
what to include and what the opaque interfaces should look like...
--
If you lie to the compiler, it will get its revenge. -- Henry Spencer
Oct 19 '06 #4
David Mathog wrote:
One thing that keeps coming up in this forum is that
standard C lacks many functions which are required in
a workstation or server but not possible in an embedded controller.
This results in a plethora of "don't ask here,
ask in comp.x.y instead",
Yes, according to the regulars here, its the worst 99.99% of
programmers that are making the remaining 0.01% look bad.
[...] for queries on functions that from the
documentation available to the programmer appear to be part
of the C language. I think largely because of this "least common
denominator" C language standard we have POSIX, XPG4, etc, which
add these useful and in many instances necessary pieces. And this
multiplicity of standards can be a real pain. I would really rather
write code that complies with _ONE_ language standard than write code
that has to comply with _MANY_ interrelated language standards.
Unfortunately you are only addressing a real world problem that most
programmers have issues with. This group only deals with non-problems
having to do with the narrowest irrelevancies of the C language
standard.
Just for the sake of argument, would it be so terribly wrong for the
ISO/ANSI C standard to define capabilities relevant for computers
other than dishwasher controllers?
It would be worth it for them to at least consider *addressing* the
problem in a well designed way. A good example of this is a library of
my own making, "The Better String Library" ( http://bstring.sf.net/ ).
It is a narrowly focussed library dealing with strings. However, it
provides useful abstracted interfaces to IO, while still remaining
fully ANSI. So if you have a platform specific IO stream, such as a
socket or something like that, you just have to supply the very base
primitives, and connect it up with the Better String Library, and you
will be able to leverage all of the Bstrlib algorithms applied to your
platform-specific IO. Its fairly straight forward and allows you to
manage your portability issues as easily as possible.

The problem is that the C language committee standards people are *not*
serious programmers or designers. They don't know, they don't care,
and they are not capable of thinking about these sorts of things. They
would rather make C++ incompatible complex numbers (that totally
ignores the possibility of making guassian integers) than truly generic
interfaces that solve real world problems. They seem blissfully
unaware that computers use graphical interfaces, that disks can hold
files that can exceed 4GB in size (and in fact can be infinite in size
(consider the output of "yes")), that buffered event sampling input
interfaces are the norm, or that there is such a thing as the internet.
There is at least one member of standards committee that is convinced
that the Unicode standard is doomed to long term failure (though he was
too chicken to take me up on a bet).
[...] For instance, if the language
required the compiler define for the target platform these constants as
0 (not present) or 1 or higher (present, with number indicating various
future revision levels):

ISOC_CAPABILITY _MULTIUSER
ISOC_CAPABILITY _NETWORK_IPV4
ISOC_CAPABILITY _NETWORK_IPV6
ISOC_CAPABILITY _FILELOCKING
ISOC_CAPABILITY _INTERPROCESS
etc.

The code could test for these, and if present, utilize the relevant
supported functions. For instance, if MULTIUSER was defined then
some form of "getusernam e" would be supported.
Well this would be useful for exposing primitives capabilities.
Probably a better way of doing this would be to introduce namespaces
into the C language, and then define functional interfaces within their
own namespaces and then specify that the each of these namespaces would
be optional.
Note that this is more or less what compilers do now, except that the
constants refer to POSIX, XPG4, etc, and it is not so much including by
capability, but including by language extension, with the latter rarely
clearly associated with the former. This results in insanely messy
compiler provided include files in which it is often painful to trace
through the logic to determine which combination of posix,xpg4,ansi etc
must be set at compile time to obtain the desired functions.
Well here's the thing. If you don't buy into the namespace thing, or
you (probably rightly) believe that there is no way that the ANSI C
standard committee would go for it, then in fact, the ANSI C committee
itself has very little to offer anyways.

The credibility of the ANSI standard is at an all time low. With the
introduction of C99 and its near universal defacto rejection, the
committee no longer has real influence in what the programming
community at large really does. In the latest fiasco, they have been
taking advice from Microsoft on how to secure the language from Buffer
Overflows. No you did not misread that (they probably buy anti-spam
products from the random advertisements they receive in their email
inboxes as well.) Going forward, nobody will pay attention to the ANSI
C committee anymore. Their standards from here on in are basically
dead letters. The only possible reader of the standard is, in fact,
the C++ standards committee (which seems to be far more credible at
this point.)

If all you want to do is set up some macros and provide unified APIs,
then probably the right answer is to do it yourself and try to
popularize it yourself. You will have more adoption, and you will not
have to try to fight the uphill battle of convincing the ANSI C
committee of the value of your idea.

Sound crazy? Here's another example:

http://www.pobox.com/~qed/pstdint.h

Its a substitute for C99's <stdint.h>. The difference is that you can
plug it into *most* ANSI C89/90 C compilers. So I took one of the few
truly valuable things in C99, extracted it, and have supplied a
universal version that anyone can use without causing backward
compatibility problems. See how that works? See how the ANSI C
committee is entirely useless for serving the exact same purpose?
For those purists who work on embedded controllers the potential
availability of these extra functions should pose no problem whatsoever.
They are perfectly free NOT to use them. The cross compiler would
negate these constants so that any code that accidentally tried to
use a function not supported on the target platform would be flagged at
compile time.
Right. But I think the point is that the ANSI C committee will be of
no help to you here. You should try to start something yourself.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

Oct 20 '06 #5
we******@gmail. com writes:
[snip]
Sound crazy? Here's another example:

http://www.pobox.com/~qed/pstdint.h

Its a substitute for C99's <stdint.h>. The difference is that you can
plug it into *most* ANSI C89/90 C compilers. So I took one of the few
truly valuable things in C99, extracted it, and have supplied a
universal version that anyone can use without causing backward
compatibility problems.
[snip]

Doug Gwyn wrote something similar some time ago; see
<http://www.lysator.liu .se/c/q8/index.html>.

I haven't compared your <stdint.himplem entation with his.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Oct 20 '06 #6

<we******@gmail .comwrote in message
news:11******** *************@i 3g2000cwc.googl egroups.com...
<snip>
http://www.pobox.com/~qed/pstdint.h
I've got a couple of questions, if you don't mind.

First, why did you use the optional (and not fully portable) feature of
space between '#' and the preprocessor directives?

Second, I'm trying to decide how I want to release some code of mine: Public
Domain (current preference...), or copyrighted and licensed: GPL, LGPL, MIT,
my own, or some other. So far, I have input from my brother, who is an IP
attorney, but doesn't specialize in copyright law. You chose a copyright
and licensed model. How did you decide that? Do you have any intent to
profit from your code? If not, why didn't you release under Public Domain,
GPL/LPGL, MIT, etc?
Rod Pemberton
Oct 20 '06 #7
"Rod Pemberton" <do*********@bi tfoad.cmmwrites :
<we******@gmail .comwrote in message
news:11******** *************@i 3g2000cwc.googl egroups.com...
<snip>
> http://www.pobox.com/~qed/pstdint.h

I've got a couple of questions, if you don't mind.

First, why did you use the optional (and not fully portable) feature of
space between '#' and the preprocessor directives?
How is that not fully portable? Any C90-conforming (or
C99-conforming) compiler should accept preprocessor directives with or
without whitespace before or after the '#' character. Do you know of
a current compiler that doesn't allow this?

[snip]

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Oct 20 '06 #8
Rod Pemberton wrote:
<we******@gmail .comwrote:
<snip>
http://www.pobox.com/~qed/pstdint.h

I've got a couple of questions, if you don't mind.

First, why did you use the optional (and not fully portable) feature of
space between '#' and the preprocessor directives?
My target platforms are ANSI C compilers, not pre-cambrian compilers.
I don't have a physical copy of any compiler that fails on the space
after #, so I have no way to test it anyways. I also want to be able
to reasonably maintain the code. Similarly, the include file assumes
your machine is 2s complement, and doesn't support wierd stuff like 40
bit or 36 bit integers.

You are exactly the second person to ask me about this issue (the other
person was using a compiler that clearly was not ANSI -- I told him to
do the find and replace himself, since his platform was so marginal and
since my maintenance was intended for the long term), so if you can
identify a serious amount of development on a compiler that fails on
this issue, I will take this criticism seriously. But for marginal
environments, I imagine that those sorts of developers are already used
to doing that kind of grunt work for all the open source they consume
anyways.
Second, I'm trying to decide how I want to release some code of mine: Public
Domain (current preference...), or copyrighted and licensed: GPL, LGPL, MIT,
my own, or some other. So far, I have input from my brother, who is an IP
attorney, but doesn't specialize in copyright law. You chose a copyright
and licensed model. How did you decide that? Do you have any intent to
profit from your code? If not, why didn't you release under Public Domain,
GPL/LPGL, MIT, etc?
The license is basically a no-slander and no use in SCO-like lawsuit
license. It is usable in any BSD or GPL project, but without
inheriting their additional licensing requirements. The same question
could be applied to if you wanted to add public domain source code to
an open source project. The PD source clearly does not gain the
additional license restrictions. There are also GPL projects that
refuse to incorporate BSD code, and vice versa, so picking one or the
other doesn't make it universal.

There are a few differences. One is that SCO becomes barred from using
my source to launch a lawsuit, whereas, in the current lawsuit between
SCO and IBM, the GPL is actually neutral. A second is that if MS
wanted to take a GPL or BSD project, modify it so that it was
functionally worse then repropogate it through their license then use
it as an example in some rigged publication of why open source is worse
than their software, for example, they could do so and nothing in those
licenses would stop them. In both cases, the offending parties are
unable to perform said action on my license.

My license is otherwise fairly straight forward and easy to comply with
-- in practice its kind of a more liberal BSD license. I have no
profit motive.

I am not a lawyer, and I find it kind of repugnant that lawyers need to
be consulted just to engage in the practice of open source development.
So I created a license that was stragically meant to cost people who
use lawyers for evil purposes more money than those who merely wish to
engage in the art.

For the Better String Library license I was a bit torn. In that case I
*WANT* Microsoft, SCO and whoever else wants to use my library. My
feeling for a library like that was that going for altruism for ego
compensation was the right answer. But this may have ended up
alienating "GPL-only" projects, or Richard Stallman or Linus Torvalds,
or whatever fanatics who don't like the BSD license. So I recently put
it under dual license, GPL *and* BSD (you can choose either to use it
under.) But this, of course is another issue.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

Oct 20 '06 #9

<we******@gmail .comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
Rod Pemberton wrote:
<we******@gmail .comwrote:
<snip>
http://www.pobox.com/~qed/pstdint.h
I've got a couple of questions, if you don't mind.

First, why did you use the optional (and not fully portable) feature of
space between '#' and the preprocessor directives?

My target platforms are ANSI C compilers, not pre-cambrian compilers.
I don't have a physical copy of any compiler that fails on the space
after #, so I have no way to test it anyways. I also want to be able
to reasonably maintain the code. Similarly, the include file assumes
your machine is 2s complement, and doesn't support wierd stuff like 40
bit or 36 bit integers.

You are exactly the second person to ask me about this issue (the other
person was using a compiler that clearly was not ANSI -- I told him to
do the find and replace himself, since his platform was so marginal and
since my maintenance was intended for the long term), so if you can
identify a serious amount of development on a compiler that fails on
this issue, I will take this criticism seriously. But for marginal
environments, I imagine that those sorts of developers are already used
to doing that kind of grunt work for all the open source they consume
anyways.
No serious criticism. I haven't seen a modern compiler that doesn't accept
it in about a decade, i.e., "pre-cambrian." I just find it a really awkward
to read. Of course, there are still a number of "pre-cambrian" versions of
C floating around out there, like some of the 32-bit ports of Small C...

<snip>
Thanks for the response on the copyright issues. Some food for thought.
Rod Pemberton
Oct 21 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
1913
by: mpinsley | last post by:
We are a software company that provides Inventory & Procurement mangement to the hospitality industry. For the past twenty years we have been using Progress Software as both the development language and the underlying database. We are in the process of exploring new languages to write our application in, as Progress is becoming expensive for us. Here are some of our issues 1. Progress is a 4GL language so it is very rapid development....
49
2897
by: Ville Vainio | last post by:
I don't know if you have seen this before, but here goes: http://text.userlinux.com/white_paper.html There is a jab at Python, though, mentioning that Ruby is more "refined". -- Ville Vainio http://www.students.tut.fi/~vainio24
134
8097
by: evolnet.regular | last post by:
I've been utilising C for lots of small and a few medium-sized personal projects over the course of the past decade, and I've realised lately just how little progress it's made since then. I've increasingly been using scripting languages (especially Python and Bourne shell) which offer the same speed and yet are far more simple and safe to use. I can no longer understand why anyone would willingly use C to program anything but the lowest...
669
26406
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
24
2470
by: noridotjabi | last post by:
Why isn't there a Graphical User Interface standard? Think about it for a second. You may say, well evey systems API for GUIs is differnt, but do take into acound: every operating system requires differnt compilations and often totally differnt compiler code. For instance gcc on windows in not the same code as gcc on linux/unix but it produces the same programs when you use it to compile. Yes you can take something like: #include...
7
1770
by: cess | last post by:
Hi!!! i would like to know if what is lacking in the codes below to have a greatest common denominator of two given(by the user) numbers?? I'm confused and i need your help! import java.io.*; public class gcd { public static void main (String args)throws Exception { String number;
3
1218
by: samwyse | last post by:
I'm a relative newbie to Python, so please bear with me. There are currently two standard modules used to access archived data: zipfile and tarfile. The interfaces are completely different. In particular, script wanting to analyze different types of archives must duplicate substantial pieces of logic. The problem is not limited to method names; it includes how stat-like information is accessed. I think it would be a good thing if a...
15
3689
by: judge82 | last post by:
I'm new to Java and I was looking for some help on this particular problem. I need to create a method that can simplify a fraction, that is, represent it as a fraction where the numerator and the denominator have no common divisors. it should read in the numerator and the denominator and then print out the fraction in its simplified form. I tried to calculate it with: while n!=0 { r = m mod n; m = n; n = r;
270
9672
by: jacob navia | last post by:
In my "Happy Christmas" message, I proposed a function to read a file into a RAM buffer and return that buffer or NULL if the file doesn't exist or some other error is found. It is interesting to see that the answers to that message prove that programming exclusively in standard C is completely impossible even for a small and ridiculously simple program like the one I proposed. 1 I read the file contents in binary mode, what should...
0
9957
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9799
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11173
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10434
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9593
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7988
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4635
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.