What does near intialization mean

C

Chris Dollin

Richard said:
You have no argument. This is a help group. People come here for help.
If the argument is that the "answer is already out there" then you might
as well close the group.

The argument is that /some/ answers are already out there, not that /all/
of them are, and that helping is /more effective all round/ if people
take the trouble to look /first/ and newsgroup afterwards [if looking
didn't help].

Put bluntly (which is really the only way I know), people who aren't
prepared to look first aren't worth helping. People who don't /know/
that they should look first are, and part of that help is to say that
there's a whole bunch of these other resources.

And just because I think people /should/ look elsewhere first doesn't
mean I'm compelled not to help them, nor that people who help them
regardless are worthless scum (just behaving sub-optimally /in my
judgement/).
Clear the mantle piece. I think that one post won it for you ....

Mantlepiece, ha. It won't fit on a /mantlepiece/.
 
K

Kenny McCormack

[/QUOTE]

I've shown time and time again that every single question that could be
asked here is either:
1) OT
or 2) Answered in the standard (this by definition, since if it
isn't in the standard, it is OT)

Note that the one area of wiggle-room is the area of
"language-lawyering", where you discuss whether or not the standard
means what it says. This is very similar to real life lawyering, and
shares the attribute that while being fascinating to those in the
"in-crowd", is utterly boring and irrelevant to sensible people.
 
R

Richard

Chris Dollin said:
Richard said:
You have no argument. This is a help group. People come here for help.
If the argument is that the "answer is already out there" then you might
as well close the group.

The argument is that /some/ answers are already out there, not that /all/
of them are, and that helping is /more effective all round/ if people
take the trouble to look /first/ and newsgroup afterwards [if looking
didn't help].

Put bluntly (which is really the only way I know), people who aren't
prepared to look first aren't worth helping. People who don't /know/

Coming here is looking. But looking to converse. There are many
resources out there which are plain wrong.
 
K

Kenny McCormack

Richard Heathfield said:
Physician, heal thyself. So far, you have had nothing whatsoever to say
about C in this thread or in any other recent thread. Indeed, a Web search
of Google's archives reveals only two articles from you that were posted
before today, both on January 5th, one of which contains an incorrect
claim about C and the other of which contains an acknowledgement that the
claim was incorrect.

If you have nothing to say...

Can you say "infinite redux" ???
 
K

Kenny McCormack

Richard Heathfield said:
Ho-hum - dated yesterday, yes... okay, it was outside *this* thread, fair
point... and yes, you're begging for C help, so yes, that's C-related all
right... but really, I see nothing there to change my view significantly.
Your contributions to this group remain at the microscopic level. When
you've spent a few years giving high-quality C help here, maybe I'll be
interested in your views on the dynamics of comp.lang.c - but until then,
<yawn>.

Oh, the irony...

Tears to my eyes.
 
R

Richard

Oh, the irony...

Tears to my eyes.

Playing the "length of service" card again I see. Ironic considering a
couple of the clique now appear to think helping others is now beneath
them unless the poster has a stamped certificate from Google
guaranteeing that they had first done their due diligence before taxing
the likes of Mr mighty intellect.
 
C

Chris Dollin

Richard said:
Playing the "length of service" card again I see. Ironic considering a
couple of the clique now appear to think helping others is now beneath
them unless the poster has a stamped certificate from Google
guaranteeing that they had first done their due diligence before taxing
the likes of Mr mighty intellect.

I trust that's not intended to be a representation of my position.
 
K

Kenny McCormack

Playing the "length of service" card again I see. Ironic considering a
couple of the clique now appear to think helping others is now beneath
them unless the poster has a stamped certificate from Google
guaranteeing that they had first done their due diligence before taxing
the likes of Mr mighty intellect.

So true. So true.
 
R

Richard

Chris Dollin said:
I trust that's not intended to be a representation of my position.

No. But it's not so far off since in the other thread you are suggesting
that people should do their own work before coming here. My counterpoint
is that coming here is doing just that work but involving a more human
dialogue. You are always polite and courteous and don't seek to confuse
through almost purposeful obfuscation of simple enough facts about the C
language. Some do.
 
R

Richard Heathfield

Chris Dollin said:
I trust that's not intended to be a representation of my position.

Chris, he's a troll. You know this. What did you expect, objectivity?
 
K

Keith Thompson

Spiros Bousbouras said:
Aditya said:
I am using a line of as
char recvedValues[ROWS][COLUMNS] = {'\0'};
in my code. I get a warning as near initialization for
recvedValues[0].
I am using gcc 3.4
Can anybody please explain the meaning.

Google for it... Or RTFM perhaps.

Perhaps he did Google for it. I did and the only match I
get is this thread. As for the manual does the GCC manual
explain the rationale for warnings ? As a matter of interest
does any compiler manual do that ?

Googling for the actual message, rather than for a paraphrase of it,
might have been more successful. The phrase "near initialization", as
it turns out, isn't a description of the problem, just of where in the
code the problem occurs. The OP managed to give us the piece of the
puzzle that mattered least.

In this case, though, it's likely that neither a Google search nor the
gcc documentation would have provided the explanation that's already
been given in this thread. The OP's error was not necessarily failing
to search elsewhere, it was failing to provide enough information,
specifically the *exact* code and warning message, copy-and-pasted.

(Ideally, he could also have mentioned that he had tried Google and
"info gcc" and not gotten an answer, but I'm not going to complain
about that. I like to see questions that are as complete as possible,
and I'll provide advice on how to ask good questions, but I'm not
going to insist that everyone must post perfect and complete questions
every time.)

As I said elsethread, I tried this code:

#define ROWS 3
#define COLUMNS 3
char recvedValues[ROWS][COLUMNS] = {'\0'};

with "gcc -Wall" and got this:

c.c:3: warning: missing braces around initializer
c.c:3: warning: (near initialization for 'recvedValues[0]')

gcc is asking for a fully braced initializer, even though it's not
necessary. That's an issue that's entirely appropriate for discussion
in comp.lang.c (and we've been discussing it in this thread).

So IMHO Mark Bluemel's response ("Google for it... Or RTFM perhaps.")
wasn't quite right -- but I'm not flaming him for that. We all make
mistakes, and the OP's question was answered.

Another thing I probably should have mentioned is that in an array
initializer with a single value, such as
... = {'\0'};
that value is not propagated to the other elements of the array.
You might expect this:
int arr[5] = { 42 };
to be equivalent to
int arr[5] = { 42, 42, 42, 42, 42 }; /* nope */
but in fact it's equivalent to this:
int arr[5] = { 42, 0, 0, 0, 0 };
Elements whose values aren't specified are set to zero. It doesn't
happen to matter for the OP's code, but since the initializer {'\0'}
does set all the elements to '\0', it would be easy to draw the wrong
conclusion. For this reason, I prefer the idiom ``{ 0 }''; it seems
slightly less misleading.

Finally, this is a good resource:

http://www.catb.org/~esr/faqs/smart-questions.html
 
K

Keith Thompson

Richard said:
Mark Blumel has a history of telling people to RTFM : maybe he should
reconsider just why he is in this NG.

Why are *you* in this newsgroup? The vast majority of your postings
are complaints about other posters.
 
D

Dik T. Winter

Original article:
> >> Aditya wrote:
> >> > I am using a line of as
> >> > char recvedValues[ROWS][COLUMNS] = {'\0'};
> >> > in my code. I get a warning as near initialization for
> >> > recvedValues[0].
> >> > I am using gcc 3.4
> >> > Can anybody please explain the meaning.

> Googling for the actual message, rather than for a paraphrase of it,
> might have been more successful. The phrase "near initialization", as
> it turns out, isn't a description of the problem, just of where in the
> code the problem occurs. The OP managed to give us the piece of the
> puzzle that mattered least.

I think it is a combination of being not very familiar with English and
bad formatting of the warning messages from gcc. If you look at the
error messages, it appears that gcc is issuing two warnings. One about
there not being enough braces to the taste of gcc, and the other as
quoted above. Somebody who does not see that both warnings are actually
a single warning can easily get confused. I think the error is on gcc's
end by prefixing the second message also with the string "warning".
> #define ROWS 3
> #define COLUMNS 3
> char recvedValues[ROWS][COLUMNS] = {'\0'};
>
> with "gcc -Wall" and got this:
>
> c.c:3: warning: missing braces around initializer
> c.c:3: warning: (near initialization for 'recvedValues[0]')

So, why is the second message *also* prefixed as it is? It should really
not be prefixed as it is actually a continuation of the first line.
 
C

Chris Dollin

Richard said:
Chris Dollin said:


Chris, he's a troll. You know this. What did you expect, objectivity?

At this time, I don't believe he's a troll. (Being an argumentative bagrag
doesn't make him a troll; otherwise, for example, I'd qualify.)
 
R

Richard

Chris Dollin said:
At this time, I don't believe he's a troll. (Being an argumentative bagrag
doesn't make him a troll; otherwise, for example, I'd qualify.)

I am not a troll. I simply do not like Heathfield's modus operandus, his
attempts at wordy obfuscation, his constant attempts to lambast others
such as Jacob nor his self obsessed persona.

That is not being a troll. But Mr Heathfield will believe that since he
believes he was appointed by him on high to spread the good word. I find
it depressing that a couple of regulars have seen fit to emulate his
flowery prose and general disdain for anyone that doesn't see it his
way.

And it's a shame because he is, without a doubt, a knowledgeable person
as far as the standard goes. But any man who can post here that there
is "no such thing as global variables in C" ought to reconsider his
position as a teacher/guru in my opinion.

"Indeed".
 
K

Keith Willis

At this time, I don't believe he's a troll. (Being an argumentative bagrag
doesn't make him a troll; otherwise, for example, I'd qualify.)

When was the last time he posted signal rather than noise? He's a
troll, and he lives in a twit-filter.
 
R

Richard

Keith Willis said:
When was the last time he posted signal rather than noise? He's a
troll, and he lives in a twit-filter.

Many times. And you might be surprised at just what S/N exists for
others we are discussing here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,813
Messages
2,569,699
Members
45,491
Latest member
JennyPerso

Latest Threads

Top