What is on topic here

L

lawrence.jones

Richard Heathfield said:
Yes. I am guessing that the shift from C0x to C1x suggests that they've
dropped a decade either in the hope that C99 will catch on in the
interim, or in the recognition that it won't, so that a big
(decade-long!) re-think is required.

No, more a recognition that it wasn't going to get done by 2009. C89
was actually finalized in 1988 and got delayed a year due to a
procedural snafu, C99 just barely made 1999, and we knew we weren't
going to make 2009 for the new revision. The current plan is to have a
new standard in 2011 or 2012, so it's just a small slip from the
historical 11 year schedule, not an entire decade.
 
E

Ersek, Laszlo

Good point. I don't use them a lot, but where I do they are great.
Particularly for some of those strange unix functions like setitimer. I
used one to great effect there (I had one parameter that came to my
function, all the rest being pre-defined).

In my opinion, that's not portable, unless you combine the compound
literal with designated initializers.

http://www.opengroup.org/onlinepubs/9699919799/basedefs/sys_time.h.html

----v----
[OB] The <sys/time.h> header shall define the itimerval structure, which
shall include AT LEAST the following members:

struct timeval it_interval Timer interval.
struct timeval it_value Current value.
----^----

(emphasis mine). The quote is from SUSv4, but earlier versions use
similar language:

http://www.opengroup.org/onlinepubs/000095399/basedefs/sys/time.h.html
http://www.opengroup.org/onlinepubs/007908775/xsh/systime.h.html

(I can't provide a link to SUSv1, but it's no exception either.)

Neither the order of these two members nor the positions of any
additional members are specified.

Cheers,
lacos
 
E

Ersek, Laszlo

The big win for me has been compound literals, actually. I love them.
Very handy, very idiomatic.

C99 6.5.2.5 "Compound literals", paragraph 10:

----v----
EXAMPLE 2 [...] in
void f(void)
{
int *p;
/*...*/
p = (int [2]){*p};
/*...*/
}

p is assigned the address of the first element of an array of two ints,
the first having the value previously pointed to by p and the second,
zero. [...]
----^----

Is the assignment correct because the end of an initializer is a
sequence point? (C99 6.5.2.5p7 and Annex C.) "p" is written to once and
read once, and the new value of "p" is not based on the previous value
of "p".

Thanks,
lacos
 
N

Nick

In my opinion, that's not portable, unless you combine the compound
literal with designated initializers.

Well obviously it's not portable, that's why it's in my "adjust this bit
of code depending on your system file".

Really, though, thanks for that. I think you're right, it's not even
portable across SUS systems. Shame!
 
S

Seebs

Jacob's wording relating to make was "makefile problems related to the
building of a c program". I fully support that.

I don't.

Let me explain why.

I am trying to build a C program.

As part of that process, I need to debug the following hunk of GNU make
code:

$$(foreach i,$$($(1)_LDAT_indexes),@$$(foreach j,$$(wordlist $$(word $$i,$$($(1)_LDAT_starts)),$$(word $$i,$$($(1)_LDAT_ends)),$$($(1)_LDAT_list)),$$(call $(1),$$j) ; )$$(LDAT_nl))

This is absolutely in the path I use to end up causing make to invoke a C
compiler. I'm pretty sure, though, that it hasn't got a thing to do with
C.[*]
Header file and source code organisation should be (is?) very much
topical, and 'make' pertaining to C is fundamentally tied to how
source files depend upon one another.

I don't think so; see above.
I for one do not know where to ask "How do I setup the makefile to
resolve a cyclic dependency between P.h and Q.h?" or "'make' does not
trigger a build of X.c when I changed file Y.h. How do I determine
what all source file X.c depends upon?", or "make triggers rebuilding
source that is up to date" and so on. Answers to such questions can
come only from experience and most definitely /not/ found in the
standard.

If I were running into stuff like that, I'd probably ask in
comp.unix.programmer, if I were using make on a UNIX system... and if
I weren't, I'd probably want a group where people were likely to be using
the same "make" I was.

-s
[*] It is part of the solution to the general question "what do you do if you
want to expand a macro for each item in a large list, but the resulting
expansion may exceed the allowed length of a shell command, but you don't
want to start a separate shell for each item in the list".
 
S

Seebs

In my opinion, that's not portable, unless you combine the compound
literal with designated initializers.

Right.

But designated initializers are in there too, and as a result, I saved
a ton of time and visual complexity in some otherwise hairy code.

-s
 
K

Kenny McCormack

Keith Thompson said:
Note that this is a least as much about helping questioners find the
best possible answers as it is about maintaining a good signal/noise
ratio here in clc.

Actually, Keith, it has to be (superficially, i.e., in terms of what you
will publicly admit) *entirely* a matter of "helping questioners" (i.e.,
newbies) "find the best possible answers" to their questions. Because
if it were about (to any extent at all) "maintaining a good signal/noise
ratio here in clc", then you'd have to apply these standards to the
regs.

And that clearly doesn't happen (and never will). The regs are
(obviously) free to yack and yammer about whatever they want, and you'll
never complain at all.
 
A

Albert

jacob navia wrote:
<snip>

This is a reply to the subject.

Suppose the OP is called A and any replier B.
If A posts a *topic* that B thinks should be in another newsgroup, B
*can* tell A that he doesn't like that and can (optionally) suggest a
more appropriate newsgroup.

This way, everyone gets ideas about where stuff should be posted given
the year, month, who are "regulars" at a certain point of time, etc.

Albert
 
F

Flash Gordon

Albert said:
jacob navia wrote:
<snip>

This is a reply to the subject.

Suppose the OP is called A and any replier B.
If A posts a *topic* that B thinks should be in another newsgroup, B
*can* tell A that he doesn't like that and can (optionally) suggest a
more appropriate newsgroup.

This way, everyone gets ideas about where stuff should be posted given
the year, month, who are "regulars" at a certain point of time, etc.

The people who want a very wide topicality strongly object to any
mention of topicality and often post more messages objecting to it than
there were messages about topicality in the first place.
 
C

Charlton Wilbur

S> (For whatever reason, the Objective-C users never seem to come
S> here.)

Perhaps the Objective-C users are smart enough to realize that they will
get more useful answers in fora dedicated to Objective-C?

I mean, Objective-C behaves as a separate language, and there's no
community of ignorant marketroids treating C and Objective-C as
interchangeable, such as you get with the "C/C++" crowd.

Charlton
 
C

Charlton Wilbur

A> Suppose the OP is called A and any replier B. If A posts a
A> *topic* that B thinks should be in another newsgroup, B *can*
A> tell A that he doesn't like that and can (optionally) suggest a
A> more appropriate newsgroup.

A> This way, everyone gets ideas about where stuff should be posted
A> given the year, month, who are "regulars" at a certain point of
A> time, etc.

And what happens then is that C, D, and E answer A's question, but only
C gets it right; B points out that D and E got it wrong, and suggests
the other newsgroup again; F and G snipe at B. Then H responds with
seven posts of pseudopsychological babble (which just about everyone
ignores), and I comes in a week later to claim that B has an
autism-spectrum disorder.

Charlton
 
O

osmium

Charlton Wilbur said:
A> Suppose the OP is called A and any replier B. If A posts a
A> *topic* that B thinks should be in another newsgroup, B *can*
A> tell A that he doesn't like that and can (optionally) suggest a
A> more appropriate newsgroup.

A> This way, everyone gets ideas about where stuff should be posted
A> given the year, month, who are "regulars" at a certain point of
A> time, etc.

And what happens then is that C, D, and E answer A's question, but only
C gets it right; B points out that D and E got it wrong, and suggests
the other newsgroup again; F and G snipe at B. Then H responds with
seven posts of pseudopsychological babble (which just about everyone
ignores), and I comes in a week later to claim that B has an
autism-spectrum disorder.

I think you've got it!
 
K

Keith Thompson

For those those self appointed proctors who insist on redirecting
people to other groups may I suggest the following wording:

Comp.lang.c probably isn't the best group for your query;
xxxx.xxxx may be a better choice. I suggest that you try
posting there.
[...]

Most of the time, that's just what I do. Naturally, I get flamed
for it.
 
K

Keith Thompson

Topicality is a fiction. There is no consensus; it is not even
clear that the "topicality" represents a majority view. All that
can be legitimately said is that the "topicality police" make the
most noise.

I disagree; I find that it's the self-proclaimed trolls who make the
most noise.
 
S

Seebs

S> (For whatever reason, the Objective-C users never seem to come
S> here.)
Perhaps the Objective-C users are smart enough to realize that they will
get more useful answers in fora dedicated to Objective-C?
I mean, Objective-C behaves as a separate language, and there's no
community of ignorant marketroids treating C and Objective-C as
interchangeable, such as you get with the "C/C++" crowd.

Could well be.

FWIW, I use Objective-C, and quite like it. I am usually able to distinguish
between questions about C and questions about Objective-C, though. (So far,
I haven't found the need to hang out on forums about it; it's usually pretty
obvious.)

-s
 
S

Seebs

For those those self appointed proctors who insist on redirecting
people to other groups may I suggest the following wording:
Comp.lang.c probably isn't the best group for your query;
xxxx.xxxx may be a better choice. I suggest that you try
posting there.
Give your inner grandfather a rest.

Is life really worth living without a daily dose of "hey, you kids!
get off my lawn!"?
In my view, the principal utility of this group lies in
illuminating programming issues associated with the C language.
For example, the C standards say nothing about threads. Some
persons claim that threads are therefore off topic. I disagree.
Particular implementations may well be best discussed elsewhere,
but the issues of using C in a threaded environment is on point.

It's a tough call. The difficulty, in general, is that the issues can
vary so widely between systems that it's hard to get good advice, IMHO.

I would not expect what is true about threaded code in UNIX to be
true about threaded code in Windows. (Well, there is one portable bit
of advice: "BE VERY VERY CAREFUL".)

-s
 
S

Seebs

I'm not surprised. Consider though, that you are sensitive to
their comments (quite understandably) and not to the comments of,
ah, the topicality police.

True. However, what I've noticed is that the "topicality police" tend
to give at least some kind of tip past just "this is off topic", but most
of the trolling is, well, devoid of signal. Although I must say, I can
think of a single occasion within the last few months when I saw a post
by one of the trolls that actually had technical content which was not
obviously wrong. I was pretty much shocked.

-s
 
F

frank

Richard said:
frank doesn't even know the difference between German and Dutch.
Usually, he doesn't even make sense in English.

Richard

And enter Richard Bos,

Is it too cold to be outside throwing your poop at people who say tja
incorrectly?

Last time I spoke dutch was in Montezuma where 3 Nederlaenderinen came
to the same hot springs. I spoke german, and they spoke english, und et
war verstanden.

My low german is berlinisch, not dat duuch. Tjo.
 
F

frank

Keith said:
For those those self appointed proctors who insist on redirecting
people to other groups may I suggest the following wording:

Comp.lang.c probably isn't the best group for your query;
xxxx.xxxx may be a better choice. I suggest that you try
posting there.
[...]

Most of the time, that's just what I do. Naturally, I get flamed
for it.

It's a statistic I've clocked from Keith for a long time. As I was a
windows user starting out, I remember that I finally had enough C under
my belt that I had started to poke into (MS) implementation specific
stuff and thought all the time that Keith was going to be there as a
roadblock. This was in the hey-day of Chuck, when he had been around
forever that he was well-respected, but before the times, where somehow
he never failed to be wrong.

Over the years, Keith has written several paragraphs with source
snippets to queries I've posted dozens of times. I did not like being
told to jump in a lake, but then maybe he kept me on the straight and
narrow long enough to understand the value of gnu software.

You didn't have to do it, but you did, and I spank you.
 
N

Nick Keighley

    A> Suppose the OP is called A and any replier B.  If A posts a
    A> *topic* that B thinks should be in another newsgroup, B *can*
    A> tell A that he doesn't like that and can (optionally) suggest a
    A> more appropriate newsgroup.

    A> This way, everyone gets ideas about where stuff should be posted
    A> given the year, month, who are "regulars" at a certain point of
    A> time, etc.

And what happens then is that C, D, and E answer A's question, but only
C gets it right; B points out that D and E got it wrong, and suggests
the other newsgroup again; F and G snipe at B.  Then H responds with
seven posts of pseudopsychological babble (which just about everyone
ignores), and I comes in a week later to claim that B has an
autism-spectrum disorder.


better grammer would be "and I come in a week later..."

When do we start using greek letters?
 

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,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top