[mod.ber] net.lang.c

ber@gummo.UUCP (ber) (02/27/84)

Summary of net.lang.c for period 2/13/84 - 2/22/84
    as seen at utah-gr by Spencer Thomas 
    53 Messages (1255 - 1328)

Further discussion of ANSI C Standard proposal.  Mostly
concerning parameter declarations. (1)

Question on semantics of cat = foo ? fu = bar : mouse. (2)
    Responses: Since there's only one legal parse, what's the question?
        It's not precedence, but order of evaluation that matters(2)
    A complaint that the C compiler for the GEC 63/30 handles this wrong.
        The message asks people to please parenthesize to death, especially
        in macro definitions.

Further discussion of imbedded \0 characters in strings.  (1)

Discussion of casting pointers to get a fast byte copy. (3)

Gross hack to discover if characters are signed in the preprocessor.

A question about if versus ?: constructs.
    A claim that the compiled code should be identical for both constructs.
    In one case, ?: generates more code than if ... else.
    Explanation of why this is reasonable.
This was prompted by a line in K&R saying that the compiler discards 
    expressions with no side effects.  A respondent points out that some
    machine dependent code depends on the "discarded value" for "asm" escapes.

Further discussion of ones complement arithmetic - appears to be winding down.

A proposal for a preprocessor construct to comment out code.
    A suggestion that "#ifdef COMMENTED_OUT_CODE" works fine, is clear, and
    doesn't require modifying the compiler.

"Why C doesn't optimize".  Report on a head-to-head confrontation between
C and Bliss compilers.  A multiple message report.  Long and detailed.  Of
course, C lost.
        Response that at least one of the comparisons is full of air.
        Retort that it is not (with some supporting documentation).

A question about curses (what's this doing in here?).

Should the shell print "sh: error message"?  (Continuing discussion, triggered
by a complaint about programs which just exit(1) on error, with little or no
error message.
        One message proposes that programs should print their name if other
        programs are running concurrently, and, if you are logged in to more
        than one machine, they should also print the machine name! (I think :-)

A request for language design features for multiprocessor kernel implementation. 

What does the Fortran keyword do?

mcnc!ecsvax!bet wants a C compiler for IBM 370 under OS/MVS

On the Orion (and maybe other machines) structs are passed as arguments on a
separate stack.  This breaks certain printf usages.
    Comment that passing structs to printf is gross.
    The behaviour of the Orion is "within spec", the language defn is silent
    about the exact parameter passing mechanism.

Is a semicolon required after the last field in a struct?
    It doesn't hurt to put it in, for sure. (1)
    C manual requires it. (2)

Multiple group message about "automated standardizing system".  Looking for
categories suitable for standardizing and specific suggestions.  If you
contribute, you get a copy of the finished product.

uucp@harpo.UUCP (uucp) (05/22/84)

Summary of net.lang.c for period 5/7/84 - 5/22/84
    as seen at utah-gr by Spencer Thomas 
    Articles 1770 - 1782 (113 articles)

                Continuing discussions

Prototyping vs "bugging" vs "hacking".
    Anecdotal report of a two week planning session in the Maine wilds
      which produced totally unworking code (some people take vacations ...)
    A recommendation for DeMarco's Structured Design.
    Lots of discussion of this point, with some defending iterative,
      "seat-of-the-pants" program design, and others planning ahead.  One
      factor seems to be for whom the software is written (self or another)
      When writing for another, communication between programming and user
      is important.
    "Getting it right the first time" philosophy is hogwash.
    They DO build houses the way we build programs (almost enough to make
      you want to build your own house!)

8 and 9 as octal digits (tide is running strongly against).

More on long, unparsable sequences of +s and -s (b+++-++c).

Attack on and defenses of DeSmet C.

Methods of forming tokens (the "cat" macro in C).  Candidates include:
1.  #define cat(a,b) a/**/b
2.  #define cat(a,b) a\
b
3.  #define I(x)    x
    #define cat(a,b) I(a)b

Lots more on return expr vs return (expr).  Branching off into syntax of
    if (), while (), etc.

References to Brad Cox articles.

Another EQUEL question.

                New discussions

What versions of PCC exist and are available?  Send info to bruce@godot.UUCP.

Disgusting hack from Tom Duff using a switch statement to jump into the
    middle of an unwound loop ("Duff's Device").

Want help with C 370 (from AT&T).  Contact David Burlingame or Bob Yagmoorian
    Higher Order Software (617) 661-8900.

C compiler for IBM System 38? (mo@lbl-csam, seismo!mo)
Question on C compilers for PC and PC-XT.  Do you need to run Lattice C
    if you want Gosling's emacs? (trwrb!trwspp!aoki)

Can you use adjectives (unsigned, etc) on typedefed names?
    Apparently so.

Long article on why people program in C.  Intended to provide "intellectual
      ammunition" to those who must justify the use of C to nonbelievers.
      Summary: "C has only minor drawbacks compared to the other languages
      considered [Fortran, Pascal, Ada, Cobol]."
    Reference to "Comparing and Assessing Programming Languages -- Ada, C,
      Pascal", edited by Feuer and Gehani, Prentice-Hall.

Do side effects occur inside sizeof?  (e.g., sizeof(x++)).  On most
    compilers, they don't appear to.  Should they?
    Although the compiler DOES usually generate string space for a string
      which you take sizeof.

What's your wishlist for the C compiler?
      - True optimizing (dataflow analysis, etc.)
      - a replacement for asm.sed (inline subroutines)

uucp@harpo.UUCP (uucp) (07/02/84)

Summary of net.lang.c for period 6/15/84 - 7/1/84
    as seen at utah-gr by Spencer Thomas 
    Articles 2015 - 2069 (55 articles)

                Continuing discussions

unsigned - yes, you can say "unsigned short" and "unsigned long".
	Not according to K&R!  Well, maybe.  Depends on which part of K&R
		you read.
	Interesting sidelight: the "V7" C compiler just translates short
		into int, so you can't say "short int", but you can say
		"long short"!

Side effects inside sizeof - changes to pcc to detect and warn about them.
	Apparently the draft standard says that side effects inside sizeof
		will not occur.

C vs Algol style semicolon usage (terminator vs separator)

(How quickly they forget!)  Further discussion (under a new title) of
	appending tokens using cpp.
	Note: ANSI standard will not allow token formation by the
	pre-processor.

HQTF2: NULL as a pointer value (wasn't it only last month we ran this one
	into the ground?  It's getting as bad as "FOO" was on unix-wizards.
	Maybe it's time for an addition to the "Netiquette" guide! :-)

                New discussions

Is "a;" a legal declaration as "a" as an int?
	Arguments from the C Reference Manual say it isn't (good!), but
		some compilers accept it.

How do people do variable length structures?  (Usually with a string
	on the end.)
	Subdiscussion about 0 vs 1 length arrays for this purpose.

6809 C compiler and 8 bit ints - what do you do on machines where 16 bit
	arithmetic is horrendous?

Short discussion of argument substitution into macro definitions.

ANSI X3J11 committee has issued a draft standard for the C language, also
	including library and environment standards.

Question about default case in switch statement.
	Reasonable answer explaining why it's not a problem.  (See the 
		discussion for more info.)
	A cute program showing some really gross things about case statements.


Revised strings package posted to net.sources (by ok@edai.UUCP).

Chem Abstracts is looking for work done in the area of portability standards
	or guidelines.  Contact cbosgd!chemabs!bobr (Bob Richards).

C compiler for 8051 (but must go to object code, NOT 8051 assembler.  According
	to the author, this makes it a "true compiler".)  Contact Scott Abbot,
	ihnp4!mvuxa!sa.

Crossover from net.micro.pc: if "double a[10][20]", is "a" the same as
	"&a[0][0]"?  No - they are the same address, but different types.

Looking for pipes in Aztec C (sdcsvax!sdccs6!ix244@berkeley - John Antypas).

How to change the C compiler so it doesn't do arithmetic in double precision?
	(Ki@MIT-OZ)

Question about forming a standard way to distinguish System V, System III,
	Version 7, BSDx, ... programs from each other.  Can we agree on
	a set of #defined symbols for each?  Mail to ihuxx!ignatz (Dave Ihnat).

Looking for Ctrace debugging tool (ala SP&E April 1984) (Rich Altmaier -
	decwrl!ios!richa)

uucp@harpo.UUCP (uucp) (07/10/84)

Summary of net.lang.c for period 7/1/84 - 7/9/84
    as seen at utah-gr by Spencer Thomas 
    Articles 2070 - 2106 (37 articles)

                Continuing discussions
Variable-length strings at end of structures response summary.
    An "awe-inspiring" number of responses.
    A name: "open-ended structure".
    They are used a great deal (some feel guilty about it, though).
    Discussion of allocating space for such a structure.
    Sizeof doesn't work on them (of course)

Concatenation of symbols in pre-processor.  "A needed hack".  Maybe
    the standards committee should define a way to do it?

Need for standard CPP symbols to tell systems apart.  Should have a
    convention, so new names won't conflict with programmer defined
    symbols.
    Maybe a "pre_ansi" symbol also?

"a;" as a global declaration does declare "a" as an int.

                New discussions

A long, good summary of the C Language Standardization presentation
    by Larry Rosler (of the ANSI X3J11 committee) at the SLC Usenix
    conference.  A little editorializing, but otherwise straight reporting.
    A small amount of further discussion, mostly centering on function
    declarations.

Apparently HCR has a "C Test Suite".  Any info on this?

(Rehash, again) Bug with asm and if statement in BSD C compiler.

Anyone got Tiny-C on a 6502?  Contact Jim Gonzalez (linus!vaxine!gnz)

Question about lint and enums.  "lint and enums seem to be mutually exclusive".