Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!sdd.hp.com!cs.utexas.edu!csc.ti.com!ti-csl!tilde.csc.ti.com!axis!cuda!olson From: olson@cuda.aaet.csc.ti.com (Doug Olson) Newsgroups: comp.lang.c Subject: Portability question for structures. Message-ID: <1991Jun19.194046.17317@axis.dsg.ti.com> Date: 19 Jun 91 19:40:46 GMT Sender: news@axis.dsg.ti.com (System News Administ) Organization: Texas Instruments Incorporated, Austin, TX Lines: 47 I have a set of list processing functions that have the typedef typedef struct double_list { void *next; void *prev; char *key; } s_double_list; This is the structure that these functions manipulate. When structures are passed in they are treated as if they were s_double_list structures. The functions that call these list processing functions have structures such as typedef struct element { void *next; void *prev; char *name; int type; char *value; } s_element; typedef struct elem_buffer { void *next; void *prev; char *handle; int is_modified; int is_deleted; s_element *element_list; } s_elem_buffer; What I need to know is, how portable are the list processing functions. They are based on the assumption that the first three fields of the list structures will be void *, void * and char *. Is this a valid assumption? or can the order that fields are listed in a structure be changed by the compiler? -- ======================================================= Doug Olson | P.O. Box 149149, M/S 2227 Texas Instruments | Austin, Texas, 78714-9149 12501 Research Blvd | olson@aaet.csc.ti.com =======================================================