473,848 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Address of an array = address of its 1st element: undecidable question ?

candide <to**@free.frwr ites:
I try to find out what exactly means "an array and its address are the
same" or "have the same value".
These two statements are very different. The first one is just wrong
and I am pretty sure you did not mean to suggest that. There is no
object in C that is the same as its address.

The second one simply depends on a term that is not well-defined.

Most people consider the type to be an important part of the notion of
value, so two things of different type are not likely to be considered
the same. They may compare equal (0 == 0.0 in C) but that is not the
same. (In other languages one type can be included in another so two
values may be exactly the same even in they have different types but
that is not really the way C types work.)

Of course, people can be lax with words. I may say, off hand, that 0
and 0.0 have the same value and that is a perfectly defensible
statement but only if you know the ways in which they differ. It is
equally valid to say that they are *not* the same value. What matters
is not the answer to an ill defined question but a full understanding
of arrays, pointers, and their relationships.
Everybody seems to agree that they doesn't share the same type, of
course.
Good. That is indisputable.
For enlighting the discussion, here some more or less contradictory
quotes from clc and comp.std.c regarding this question :

-------------------------------- 8<
-------------------------------------------
On 29 juin 2004, 06:06, lawrence.jo...@ ugsplm.com wrote:
>I'm not aware of any definition (or even description) of the C language
that said that taking theaddressof anarraywas equivalent to taking
theaddressof the first member of thearray. Certainly there were
compilers that worked that way, but there were also many compilers that
considered it an error and didn't allow it at all.
This one is taken out of context. IIRC LJ was taking about historical
C compilers before the construct of taking the address of an array had
been defined by the language standard.
On 31 déc 1996, 10:00, f...@genesis.de mon.co.uk (Lawrence Kirby) wrote:
>(...) The address of an array IS the address of
it's first element.

The standard doesn't say so explicitly although a conforming
implementation
>doesn't really have much choice in the matter. (void *)&s and (void
*)&s[0]
>pretty much have to generate thesameaddress or else standard library
functions like fread() would have problems.
OK, I have no problem with that. The way in which the values are "the
same" is made explicit -- they compare equal when converted to void*.
On 7 mai 1999, 09:00, Dennis Ritchie <d...@bell-labs.comwrote:
>Paul Seale wrote:
OK, but what IS the address of an array? If we consider that in most
contexts an array name "a" is converted to &a[0], then the closest
thing I
can imagine that would be anarray addressis the address of a cell that
holds &a[0]. Seems like that is just creating an unnecessary level of
indirection. I'd be interested in an example where this would be
useful.
>>
In the usual implementation the bit value of &a[0] and &a will be the
same,
but the type is different (ptr to int, ptr to array of int).
If you add 1 to them you will get different answers.
OK. Again, I see no problem. Note the DR is careful to say "the bit
value". He does not really care about the bits, he wants a phrase
that means "the value when you have thrown away or ignored the type".
Bit value is a good way to suggest that.
On 25 fév 1996, 10:00, c2a...@ugrad.cs .ubc.ca (Kazimir Kylheku) wrote:
>Don't be fooled by the fact that the above works. It just so happens
that
>myarray and &myarray are both expressions that yield the same
pointer. But the
>two pointers have a different type.
Again, no contradiction. KK is explicit that the pointers have
different types so he must be using "the same" to mean "the same
except for the type". If KK had just said "... yield the same
pointer" and stopped there, someone would have come in to clarify the
matter. The term "the same" is just too vague to left unqualified.
On 19 sep 2006, 21:51, Keith Thompson <ks...@mib.orgw rote:
[...]
>&array is a perfectly legitimate expression; it yields the address of
the array, which is distict from the address of itsfirstelement .
They have the "same value" in some sense, but they're of different
types.
KT prefers to emphasise the difference and puts "the same" in quotes to
show that it is vague and need qualification. No contradiction that
I can see.
On 11 fév 2008, 19:47, lawrence.jo...@ siemens.com wrote:
>[...] The address of an array is the same as
the address of its first element just as the address of a struct is the
same as the address of its first member (the addresses are the same but
the types are different)
More of the same. The problem is entirely due to how the writer like
to view the phrase "the same". LJ obviously prefers to emphasise the
similarity but he, too, is careful to point out the difference.
On 7 mai 1999, 09:00, Larry Jones <larry.jo...@sd rc.comwrote:
>Paul Seale wrote:
OK, but what IS theaddressof anarray?

What's theaddressof a struct? Theaddressof a struct is "the same
as" theaddressof its first member, but they have different types.
Likewise, theaddressof anarrayis "the same as" theaddressof its
first element, but they have different types. (By "the same as", I
mean that they compare equal if you convert them both to (void *)).
Again, another careful writer putting the matter quite clearly in my
view. The "scare quotes" draw attention to the problem phrase but
both the similarities and the differences are made explicit.
So what ? Is the question undecidable ?
If you include the notion of type in that of value, then the answer is
"no". If you don't then the answer can be a qualified "yes". The
qualification is made very clear by most of the quotes ("the bit
values are the same", "they compare equal when converted to void *")
but even when it is glossed over, there is no contradiction.

My personal preference is to be strict about the types so I would say
that the values are not the same if I have to make just one statement
about them. If you were to permit me, I'd go on to say that they have
values that convert to equal void *s. The C standard is very clear
that a pointer to a whole object and pointer to one of its initial
sub-objects must compare equal (provided you convert the pointers so
that comparison is permitted) so the pointers have the same value in
that limited sense.

--
Ben.
Jun 27 '08 #1
17 2336
On May 22, 9:00*pm, Ben Bacarisse <ben.use...@bsb .me.ukwrote:
candide <t...@free.frwr ites:
I try to find out what exactly means "an array and its address are the
same" or "have the same value".

These two statements are very different. *The first one is just wrong
and I am pretty sure you did not mean to suggest that. *There is no
object in C that is the same as its address.

The second one simply depends on a term that is not well-defined.
How about using the standard definition? Then all is good and
clear, answer is "no and the question doesn't make much sense".
Making up the meaning of "value of array" is silly otherwise.
(True, it's an interesting philosophical exercise, like whether
the element of one-element array is the array or not... And it
certainly is on-topic and so is "interestin g and useful"!)

[snip long list of who (Ritchie included!) says what]

Yevgen
Jun 27 '08 #2
ym******@gmail. com writes:
On May 22, 9:00*pm, Ben Bacarisse <ben.use...@bsb .me.ukwrote:
>candide <t...@free.frwr ites:
I try to find out what exactly means "an array and its address are the
same" or "have the same value".

These two statements are very different. *The first one is just wrong
and I am pretty sure you did not mean to suggest that. *There is no
object in C that is the same as its address.

The second one simply depends on a term that is not well-defined.

How about using the standard definition?
I am not sure exactly what you mean. I don't think the term "same
value" is used clearly and unambiguously thought the standard. At
least, I don't think it is used in way that can be understood without
context.
Then all is good and
clear, answer is "no and the question doesn't make much sense".
Making up the meaning of "value of array" is silly otherwise.
The value of an array has a reasonable meaning in C. You can't so
much with them, but that is beside the point. I don't think I made up
a meaning for it.
(True, it's an interesting philosophical exercise, like whether
the element of one-element array is the array or not... And it
certainly is on-topic and so is "interestin g and useful"!)

[snip long list of who (Ritchie included!) says what]
I thought my answer was helpful because, rather than taking a
definitive view on the meaning of the words, it explained why the
various phrases quoted are all consistent provided one does not assume
that slightly ambiguous terms can be pinned down one way or the other.
Most of the quotes went to some lengths to explain why the two values
in question were the same in some sense and different in others.
Plumping for one or the other if fine (I said as much) but not as
helpful as I was trying to be. Of course, I may have missed by a mile
and just confused the OP. Only time will tell.

--
Ben.
Jun 27 '08 #3
Ben Bacarisse <be********@bsb .me.ukwrites:
ym******@gmail. com writes:
>On May 22, 9:00*pm, Ben Bacarisse <ben.use...@bsb .me.ukwrote:
>>candide <t...@free.frwr ites:
I try to find out what exactly means "an array and its address are the
same" or "have the same value".

These two statements are very different. *The first one is just wrong
and I am pretty sure you did not mean to suggest that. *There is no
object in C that is the same as its address.

The second one simply depends on a term that is not well-defined.

How about using the standard definition?

I am not sure exactly what you mean. I don't think the term "same
value" is used clearly and unambiguously thought the standard. At
least, I don't think it is used in way that can be understood without
context.
Ah, but the standard does define the term "value", in C99 3.17:

value
precise meaning of the contents of an object when interpreted as
having a specific type

Given this definition, it doesn't make much sense to say that objects
of different types can have the "same value".

(One flaw in this definition is that it doesn't define the value of an
expression.)
>Then all is good and
clear, answer is "no and the question doesn't make much sense".
Making up the meaning of "value of array" is silly otherwise.

The value of an array has a reasonable meaning in C. You can't so
much with them, but that is beside the point. I don't think I made up
a meaning for it.
Agreed; given the standard's definition of "value" the value of an
array is a fairly obvious concept.

[snip]

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 27 '08 #4
Keith Thompson <ks***@mib.orgw rites:
Ben Bacarisse <be********@bsb .me.ukwrites:
>ym******@gmail. com writes:
>>On May 22, 9:00*pm, Ben Bacarisse <ben.use...@bsb .me.ukwrote:
candide <t...@free.frwr ites:
I try to find out what exactly means "an array and its address are the
same" or "have the same value".

These two statements are very different. *The first one is just wrong
and I am pretty sure you did not mean to suggest that. *There is no
object in C that is the same as its address.

The second one simply depends on a term that is not well-defined.

How about using the standard definition?

I am not sure exactly what you mean. I don't think the term "same
value" is used clearly and unambiguously thought the standard. At
least, I don't think it is used in way that can be understood without
context.

Ah, but the standard does define the term "value", in C99 3.17:

value
precise meaning of the contents of an object when interpreted as
having a specific type

Given this definition, it doesn't make much sense to say that objects
of different types can have the "same value".

(One flaw in this definition is that it doesn't define the value of an
expression.)
To my mind, this is a fatal flaw for this discussion. The question is
all about expressions and not the values of objects.

--
Ben.
Jun 27 '08 #5
Ben Bacarisse wrote:
ym******@gmail. com writes:
>On May 22, 9:00 pm, Ben Bacarisse <ben.use...@bsb .me.ukwrote:
>>candide <t...@free.frwr ites:
I try to find out what exactly means "an array and its address are the
same" or "have the same value".
These two statements are very different. The first one is just wrong
and I am pretty sure you did not mean to suggest that. There is no
object in C that is the same as its address.

The second one simply depends on a term that is not well-defined.
How about using the standard definition?

I am not sure exactly what you mean.
I mean the definition of the term "value of an object"
from the standard.
I don't think the term "same
value" is used clearly and unambiguously thought the standard. At
least, I don't think it is used in way that can be understood without
context.
Could you provide an example perhaps? Really, once
you don't think that a "value of an array" can mean
value of the pointer it's converted to (namely, of
the result of the corresponding expression, or
whatever it is in legalese), then you don't have
any problems with the term "value" and its use in
a phrase "same value". I guess the problem is that
the standard uses human language in this case ;)
>
>Then all is good and
clear, answer is "no and the question doesn't make much sense".
Making up the meaning of "value of array" is silly otherwise.

The value of an array has a reasonable meaning in C. You can't so
much with them, but that is beside the point. I don't think I made up
a meaning for it.
>(True, it's an interesting philosophical exercise, like whether
the element of one-element array is the array or not... And it
certainly is on-topic and so is "interestin g and useful"!)

[snip long list of who (Ritchie included!) says what]

I thought my answer was helpful because, rather than taking a
definitive view on the meaning of the words, it explained why the
various phrases quoted are all consistent provided one does not assume
that slightly ambiguous terms can be pinned down one way or the other.
Most of the quotes went to some lengths to explain why the two values
in question were the same in some sense and different in others.
Plumping for one or the other if fine (I said as much) but not as
helpful as I was trying to be. Of course, I may have missed by a mile
and just confused the OP. Only time will tell.
Nah, I don't think the explanation hurt someone. It's
the question that is silly. Discussing array-related
stuff isn't bad for sure.

Yevgen
Jun 27 '08 #6
Ben Bacarisse <be********@bsb .me.ukwrites:
Keith Thompson <ks***@mib.orgw rites:
>Ben Bacarisse <be********@bsb .me.ukwrites:
>>ym******@gmail. com writes:

On May 22, 9:00*pm, Ben Bacarisse <ben.use...@bsb .me.ukwrote:
candide <t...@free.frwr ites:
I try to find out what exactly means "an array and its address are the
same" or "have the same value".
>
These two statements are very different. *The first one is just wrong
and I am pretty sure you did not mean to suggest that. *There is no
object in C that is the same as its address.
>
The second one simply depends on a term that is not well-defined.

How about using the standard definition?

I am not sure exactly what you mean. I don't think the term "same
value" is used clearly and unambiguously thought the standard. At
least, I don't think it is used in way that can be understood without
context.

Ah, but the standard does define the term "value", in C99 3.17:

value
precise meaning of the contents of an object when interpreted as
having a specific type

Given this definition, it doesn't make much sense to say that objects
of different types can have the "same value".

(One flaw in this definition is that it doesn't define the value of an
expression.)

To my mind, this is a fatal flaw for this discussion. The question is
all about expressions and not the values of objects.
It's a minor flaw in the definition of "value". (It's not the only
definition in the standard that provides an example of the term being
defined rather than an exhaustive definition). It's clear that
expressions do have values; see the standard's (also incomplete)
definition if "expression " in 6.5p1:

An _expression_ is a sequence of operators and operands that
specifies computation of a value, or that designates an object or
a function, or that generates side effects, or that performs a
combination thereof.

I think it's sufficiently clear for purposes of this discussion that a
"value", whether it's contained in an object or results from
evaluating an expression, has a specific type. I don't think it's
possible to discuss this stuff consistently without making that
assumption.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 27 '08 #7
Keith Thompson <ks***@mib.orgw rites:
Ben Bacarisse <be********@bsb .me.ukwrites:
>Keith Thompson <ks***@mib.orgw rites:
>>Ben Bacarisse <be********@bsb .me.ukwrites:
ym******@gmail. com writes:

On May 22, 9:00*pm, Ben Bacarisse <ben.use...@bsb .me.ukwrote:
>candide <t...@free.frwr ites:
I try to find out what exactly means "an array and its address are the
same" or "have the same value".
>>
>These two statements are very different. *The first one is just wrong
>and I am pretty sure you did not mean to suggest that. *There is no
>object in C that is the same as its address.
>>
>The second one simply depends on a term that is not well-defined.
>
How about using the standard definition?

I am not sure exactly what you mean. I don't think the term "same
value" is used clearly and unambiguously thought the standard. At
least, I don't think it is used in way that can be understood without
context.

Ah, but the standard does define the term "value", in C99 3.17:

value
precise meaning of the contents of an object when interpreted as
having a specific type

Given this definition, it doesn't make much sense to say that objects
of different types can have the "same value".

(One flaw in this definition is that it doesn't define the value of an
expression. )

To my mind, this is a fatal flaw for this discussion. The question is
all about expressions and not the values of objects.

It's a minor flaw in the definition of "value".
OK. I can see how /you/ see it that way but as a definition to be used
to explain (to someone learning all this) the flaw is a little more
than minor -- it is a definition that does not apply. Neither
expression in question is (or designates) an object so there are no
contents to be interpreted.

Of course it can be fixed (but see below) but I think the fact that it
has to be extended and qualified is more than a minor flaw. "Fatal
flaw" was probably too strong. If you want to stick with "minor", in
the context of someone learning C, than I won't press the matter but I
will beg to differ.
(It's not the only
definition in the standard that provides an example of the term being
defined rather than an exhaustive definition).
<aside>
Continuing your aside, I think the problem of the definition is a
little deeper than that. With the above definition, in mind some
phrases just seem daft:

"The meaning of a value stored in an object or returned by a
function is determined by the type of the expression used to access
it."

This is obviously intended to reinforce the definition and should
probably have been something like "The precise meaning of the data
stored in an object or returned by a function is determined by the
type of the expression used to access it. This is called the value of
the object or function." I say "probably" because I may have missed
the intent. What is clear is that one should not talk about the
meaning of a value if a values is defined as the precise meaning of
something else.

Then there is this:

"A constant is a primary expression. Its type depends on its form
and value, as detailed in 6.4.4."

That is circular since its value depends on the type. Of course, the
circularity can be broken by "trying" the different types in section
6.4.4 but even that is complicated because 6.4.4 says:

"The type of an integer constant is the first of the corresponding
list in which its value can be represented."

and earlier:

"Each constant shall have a type and the value of a constant shall be
in the range of representable values for its type."

It is much easier to resolve these three if we take "value" to have the
looser mathematical meaning.

Finally, the standard talks about "copying values". I don't see how
values in the sense of "precise meanings..." can be copied. I think
the standard does not take its own definition of value too seriously.
</aside>
It's clear that
expressions do have values; see the standard's (also incomplete)
definition if "expression " in 6.5p1:

An _expression_ is a sequence of operators and operands that
specifies computation of a value, or that designates an object or
a function, or that generates side effects, or that performs a
combination thereof.

I think it's sufficiently clear for purposes of this discussion that a
"value", whether it's contained in an object or results from
evaluating an expression, has a specific type. I don't think it's
possible to discuss this stuff consistently without making that
assumption.
I agree, but I don't think the standard's definition makes that
clear. It suggests that objects (and by your extension the results of
expressions) have a value only "when" interpreted. Of course, at every
point in a program, every object and expression has some effective
type which is the one used to "induce" the value, but I would prefer
that the linkage be explicit in the definition.

I think it is much simpler to view types as set of values. Objects
contain representations of values, and expressions (by dint of having
a value) have a type (the set of which the result is a member). Then,
questions about values being the same or not would be determined by the
mathematical structure of the types -- some languages use disjoint
unions so that 1 and 1.0 are not "the same value" while in others the
representable integers are stated to be a subset of the representable
floats. Of course, I have no idea if the language of the standard
could be re-cast in this form.

--
Ben.
Jun 27 '08 #8
Yevgen Muntyan <mu*****@remove this.tamu.eduwr ites:
Ben Bacarisse wrote:
>ym******@gmail. com writes:
>>On May 22, 9:00 pm, Ben Bacarisse <ben.use...@bsb .me.ukwrote:
candide <t...@free.frwr ites:
I try to find out what exactly means "an array and its address are the
same" or "have the same value".
These two statements are very different. The first one is just wrong
and I am pretty sure you did not mean to suggest that. There is no
object in C that is the same as its address.

The second one simply depends on a term that is not well-defined.
How about using the standard definition?

I am not sure exactly what you mean.

I mean the definition of the term "value of an object"
from the standard.
OK. Yes one could certainly use that definition. I don't think it is
without it problems. I've detailed some of these problems in a reply
to Keith Thompson elsewhere but despite these it is workable. In this
context, the main reason I would not cite it is that is does not
apply, since it talks about objects and neither expression in question
was an object.

I see that the discussion of that has already moved on, so this point
is probably moot, but my real objection to using it is that is does
not help answer the question that the OP had. The OP was confused by
people using phrases like "bit value" and "the addresses are the
same". Explaining what these terms meant and the ways in which they are
consistent with, for example, Keith Thompson's more formal quote
seemed more helpful.
>I don't think the term "same
value" is used clearly and unambiguously thought the standard. At
least, I don't think it is used in way that can be understood without
context.

Could you provide an example perhaps?
I've given some in my other answer. It is not specifically the phrase
"same value" that is problem it is just that the standard does not
seem convinced by its own definition.
Really, once
you don't think that a "value of an array" can mean
value of the pointer it's converted to (namely, of
the result of the corresponding expression, or
whatever it is in legalese), then you don't have
any problems with the term "value" and its use in
a phrase "same value".
Yes, I though that was clear in my answer. I am sorry if it was not.

--
Ben.
Jun 27 '08 #9
James Kuyper wrote:
Ben Bacarisse wrote:
>candide <to**@free.frwr ites:
>>Ben Bacarisse wrote:
...
>| I'm not aware of any definition (or even description) of the C language
| that said that taking the address of an array was equivalent to taking
| the address of the first member of the array.

What does "equivalent to" mean? I don't know for sure, but since the
two operations produce different types it seems a stretch to say he is
at odds with any of the other writers. The current standard says that
when suitable converted they will compare equal, but I am sure he know
that!

Citation please?

There is wording to that effect in 6.7.2.1p13 with respect to structures
and their first member, but I couldn't find comparable wording about
arrays and their first element; by analogy with structures, I'd expect
such wording to be in section 6.7.5.2; I couldn't find it there, or
anywhere else that I looked.
On May 24, 11:28 am, James Kuyper <jameskuy...@ve rizon.netwrote:
Ben Bacarisse wrote:
candide <t...@free.frwr ites:
Ben Bacarisse wrote:
...
| I'm not aware of any definition (or even description) of the C
language
| that said that taking the address of an array was equivalent to
taking
| the address of the first member of the array.
What does "equivalent to" mean? I don't know for sure, but since the
two operations produce different types it seems a stretch to say he is
at odds with any of the other writers. The current standard says that
when suitable converted they will compare equal, but I am sure he know
that!

Citation please?

There is wording to that effect in 6.7.2.1p13 with respect to structures
and their first member, but I couldn't find comparable wording about
arrays and their first element; by analogy with structures, I'd expect
such wording to be in section 6.7.5.2; I couldn't find it there, or
anywhere else that I looked.
It's not needed, because by definition of array its first byte
is the first byte of its first element. So, after *suitable*
conversion (e.g. to unsigned char*), the pointers will compare
equal, guaranteed (6.2.5p20, 6.3.2.3p7). Whether you can do

int a[3];
int *p = (int*)&a;
int ba = *p;

is another question (my guess is it's undefined, though
perhaps aliasing rules do allow this, but I don't care
anyway).

Structures are different because they may have holes and
so they need 1) explicit guarantee that there is no padding
at the beginning, and they need 2) explicit permission
for the pointer conversion because we want this conversion,
while nobody ever casts a pointer to an array to pointer
to its first element.

Yevgen
Jun 27 '08 #10

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

Similar topics

9
2322
by: Luke Wu | last post by:
Hello, I'm having some problems understanding 2 dimensional arrays. My problem relates to the following code: #include <stdio.h> #define M 3 #define N 3
33
3205
by: baumann.Pan | last post by:
hi all, i want to get the address of buf, which defined as char buf = "abcde"; so can call strsep(address of buf, pointer to token);
12
1978
by: FI | last post by:
Hello All, I am relatively new to C programming and I am struck with a problem in dynamic memory allocation. I would like to know if it is ok to pass the 'memory address' returned by malloc()(stored not in a pointer variable but as an element of an array of type int*) directly to free(). My program allocating and freeing memory this way is corrupting the heap. Can anybody guide me on this. Thanks in advance
10
2377
by: | last post by:
If I have an array of int: int array; I suppose the correct way to clear it using memset() would be: memset(array, 0, 8 * sizeof(int)); However, I've seen the following in a piece of code: memset(&array, 0, 8 * sizeof(int));
8
15029
by: =?big5?B?r0W84Q==?= | last post by:
Hi All C gurus: Below is a small program to print out the address of array and address of array variable: int main() { char array = "haha"; printf("array:%x\n", array); printf("&array:%x\n", &array); }
36
3413
by: Julienne Walker | last post by:
Ignoring implementation details and strictly following the C99 standard in terms of semantics, is there anything fundamentally flawed with describing the use of a (non-inline) function as an address? I keep feeling like I'm missing something obvious. -Jul To keep things in context, this is in reference to describing functions to a beginner.
4
1651
by: nembo kid | last post by:
I have the following bidimensional array int a ; Why the first address of this array is only: & (mat) and not also:
37
2005
by: Richard Heathfield | last post by:
candide said: They aren't. An array is an array. An address is a pointer value. These are not the same thing. If you mean that &array and &array are the same, they aren't. They have different types. If you try to take the value of an array, what you actually get is the value of a pointer to the first member of the array. That doesn't mean
7
2820
by: John Koleszar | last post by:
Hi all, I'm porting some code that provides compile-time assertions from one compiler to another and ran across what I believe to be compliant code that won't compile using the new compiler. Not naming names here to remove bias - I'm trying to tell if I'm relying on implementation defined behavior or if this is a bug in the new compiler. Consider this stripped down example:
0
9892
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10997
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...
0
10661
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10718
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
10347
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...
1
7889
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
7067
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4542
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
2
4134
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.