Re: gcc varargs problem

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

 



whoosh wrote:
On 01-Aug-08 03:22:56 Sam Varshavchik wrote:
whoosh writes:

On 01-Aug-08 03:00:09 Tom Horsley wrote:
On Fri, 01 Aug 2008 02:36:54 +0100
whoosh <whoosh777@xxxxxxxxxxxxxxxx> wrote:
64 bit Fedora 9's gcc regards this as an error, all the other gcc's eg on 32 bit Fedora Core 3 have no problem with this.
The standard regards it as an error as well, and if you looked up
the insane argument passing conventions for x86_64, you'd know why :-).
If you want to write portable code, look at the stdarg man page and
use the va_start, va_copy, etc. macros.

ok, from that man page it looks like the way to do it is:

f( va_list *pargs )

No, that's not what that man page states. See the EXAMPLE section.

is there a way to switch off the signedness errors, where
I use "unsigned char *" for strings to prevent char 255 being

sign extended to EOF?

Use explicit casts.

too much work,

this is stable code which I have been using for probably 2 years,

-Wall with earlier gcc's no errors at all, thus I need a backward
compatibility option,

once code has stabilised I dont like changing it unless it is a GENUINE problem.

It is as the compiler is (correctly) warning you of the potential
problem.  Not all compilers support the "-Wno-pointer-sign" option
and your code will generate the same warning on those systems.  It's
rather irrelevant if it's "stabilized" code or not...it's incorrect in
the same way that I could, in a past life, push a "long" onto the stack,
when calling a function and pop off two shorts in the called function.
Yes, it worked, but it was DEAD wrong.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer                       rps2@xxxxxxxx -
- Hosting Consulting, Inc.                                           -
-                                                                    -
-      The moving cursor writes, and having written, blinks on.      -
----------------------------------------------------------------------

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[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