[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

839.0. "XtCalloc and pointer alignment?" by 21850::WEAVER (Laboratory Data Products/Science) Wed May 24 1989 14:22

    Does XtCalloc setup proper pointer alignment on the PMAX?  Running
    lint I get the following warning:
    
    warning: possible pointer alignment problem
        (47)            (589)           (860)
    
    In 2 cases I doing the equivalent of:
    
        ptr = (Mytype *) XtCalloc (1,sizeof(Mytype));
    
    and the 3rd I am simply doing:
    
        ptr = (unsigned int *) XtCalloc (n,sizeof(unsigned int));
    
    Also, is there some reason the X Toolkit deviated from ANSI C
    in defining all the Xt*Alloc routines as "char *" rather than
    "void *", forcing one to typecast?
    
    						-Dave

T.RTitleUserPersonal
Name
DateLines
839.1Yes, its ok.56579::thomasThe Code WarriorWed May 24 1989 15:484
The problem happens to be with the definition of XtCalloc.  Since it is defined
as a char * and you are casting to a type which has a different alignement,
lint gives you the error.