Re: man 3 switch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 16 Nov 2009, Rick Stevens wrote:

On 11/14/2009 01:55 PM, Frank Cox wrote:

As C is an ISO standard, I sincerely doubt there would be any difference in the
syntax and behaviour of the keywords between C compilers on any Unix-like
operating system.

Incorrect.  C, for example, does not guarantee the order of evaluation
of arithmetic operators of equal precedence in the same statement (in

It does in the example given.
Binary + associates left to right.

other words, is something like "a + b + c" evaluated left to right, or right to left?). This can have significant effects if some of the
operands have "side effects"

(a+b)*(b+a) could be ambiguous.
Either sum could be performed first.
If their are side effects, order could matter.

Order could also matter if floating point is involved.
C89 doesn't require much of floating point.
It doesn't even require that the same expression with
the same data produce the same number each time.

The following function could return 1:

int fred(float a, float b)
{
int result=0;
for(int j=0; j< 10; ++j) result+=(1f< a*b);
return result;
}

I would hope not.

Another example is that a null pointer (or the value "NUL") is not
necessarily zero, only that it is guaranteed to not point at any valid
datum.

C allows quite a bit of leeway to the compiler implementation.

--
Michael   hennebry@xxxxxxxxxxxxxxxxxxxxx
"Pessimist: The glass is half empty.
Optimist:   The glass is half full.
Engineer:   The glass is twice as big as it needs to be."

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux