Sponsored Content
Top Forums Programming Parameters placement on stack in C Post 303036086 by Don Cragun on Thursday 13th of June 2019 09:28:00 PM
Old 06-13-2019
The standards don't specify how parameters are placed on the stack when a function is invoked and any code that assumes that parameters are placed on the stack in the order given (or in the reverse of the order given) in the function declaration is highly likely to fail on some operating systems on some hardware.

When an operating system is ported to or designed from scratch, the compiler group, the link editor group, and the operating system group will study the hardware design documents and agree on a scheme that they believe will be fast and conserve space on that hardware for the operating system being designed. Note that the scheme may well have exceptions that apply alternative behaviors when a function is invoked that takes a variable number of parameters (e.g., printf()). The only portable way to write functions like printf() is to use the macros defined in the Standard C header <stdarg.h> (i.e., va_start, va_arg, va_copy, and va_end).
These 3 Users Gave Thanks to Don Cragun For This Post:
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

code placement

I'm sorry if something like this has already been posted, but I didn't find anything like it. I'm using ksh The code that I've come up with will initially print what I want, but will then keep repeating the second number. I'm just trying to teach myself and can't seem to find the code to work.... (16 Replies)
Discussion started by: scott78
16 Replies

2. AIX

Aixterm icon placement?

Hi, I'm using xterm and aixterm with Mwm on AIX, and having trouble controlling icon placement when minimising windows. Basically when I run an xterm or aixterm I want to be able to specify where the icon will be if minimised. The man page mentions the "#geometry Geometry" option to aixterm,... (1 Reply)
Discussion started by: cunningdavid
1 Replies

3. UNIX Desktop Questions & Answers

Controlling icon placement?

Hi, I'm using xterm and aixterm with Mwm on AIX, and having trouble controlling icon placement when minimising windows. Basically when I run an xterm or aixterm I want to be able to specify where the icon will be if minimised. The man page mentions the "#geometry Geometry" option to aixterm,... (1 Reply)
Discussion started by: cunningdavid
1 Replies

4. Programming

what is stack winding and stack unwinding

helo can u tell me what do you mean by stack winding and stack unwinding Regards, Amit (2 Replies)
Discussion started by: amitpansuria
2 Replies

5. Solaris

Data placement in SVM

Is it possible to place the data in inner or outer edge with SVM ( solaris volume manager ) or VxVM like we can do in AIX LVM ? (1 Reply)
Discussion started by: fugitive
1 Replies

6. UNIX for Dummies Questions & Answers

Kernel Stack vs User Mode Stack

Hi, I am new to the linux kernel development area. I want to know what is the difference between kernel mode stack and user mode stack? Does each process has a user mode stack and a kernel mode stack?? Or Each process has a user mode stack and there is only one kernel mode stack that is shared by... (4 Replies)
Discussion started by: saurabhkoar
4 Replies

7. Cybersecurity

Snort/NTOP Placement

I have been asked to place 2 (1 NTOP & 1 SNORT) boxes within our network as part of our tool kit for network monitoring and Intrusion detection. Out network is very simplistic and it layed out like this: internet | | Cisco 1811 Router (8x Layer 2 switch ports) ... (0 Replies)
Discussion started by: metallica1973
0 Replies

8. UNIX for Advanced & Expert Users

Unix linked-list placement

Hi, I am programming in kernel, and I want to use a double linked list that holds infos that every process could access and modify THIS list. So, I suppose it is a 'global' variable since every process(thread) can reach it, I am wondering where to put it? by changing some of the kernel files? (1 Reply)
Discussion started by: louisTan
1 Replies
XmDropSiteConfigureStackingOrder(3X)									      XmDropSiteConfigureStackingOrder(3X)

NAME
XmDropSiteConfigureStackingOrder - A Drag and Drop function that reorders a stack of widgets that are registered drop sites SYNOPSIS
#include <Xm/DragDrop.h> void XmDropSiteConfigureStackingOrder (widget, sibling, stack_mode) Widget widget; Widget sibling; Cardinal stack_mode; DESCRIPTION
XmDropSiteConfigureStackingOrder changes the stacking order of the drop site specified by widget. The stacking order controls the manner in which drag-under effects are clipped by overlapping siblings, regardless of whether they are active. The stack mode is relative either to the entire stack, or to another drop site within the stack. The stack order can be modified only if the drop sites are siblings in both the widget and drop site hierarchy, and the widget parent of the drop sites is registered as a composite drop site. Specifies the drop site to be restacked. Specifies a sibling drop site for stacking operations. If specified, then widget is restacked relative to this drop site's stack position. Specifies the new stack position for the specified widget. The values are XmABOVE and XmBELOW. If a sibling is specified, then widget is restacked as follows: The widget is placed just above the sibling. The widget is placed just below the sibling. If the sibling parameter is not specified, then widget is restacked as follows: The widget is placed at the top of the stack. The widget is placed at the bottom of the stack. For a complete definition of DropSite and its associated resources, see XmDropSite(3X). SEE ALSO
XmDropSite(3X), XmDropSiteRetrieve(3X), XmDropSiteQueryStackingOrder(3X) XmDropSiteConfigureStackingOrder(3X)
All times are GMT -4. The time now is 04:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy