[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

857.0. "Segmentation error with MAX f77 and XLib" by LARVAE::BULLARD () Wed May 31 1989 04:15

    
        I have hit a problem using f77 on the DS3100 to write programs
    using the XLib routines.The problem seems to occur when trying to
    pass a structure to an Xlib routine.I have hit the problem with two
    routines in particular although I suspect many other are affected in
    the same way.
        The routines that I have had problems with are XNextEvent and 
    XDrawLines. I get a segmentation error.
             I have posted the question in many notesfiles but no-one
    has  responded.Also other people have hit the problem some time ago
    and they never got their problem solved.
            My question, is this a known problem and should I avoid
    using these  routines until some bug has been fixed or is it a usage 
    problem.If so could someone post a working example.At the moment I am
    thinking of QARing the problem.
            Here is how I have used the routines
                                                   
                INCLUDE '/usr/include/X11/xlibF77.h'
                INCLUDE '/usr/include/X11/xlibF77.h'
                RECORD /XEvent/              EVENT
                PARAMETER NPOINTS = 5
                RECORD /XPoint/              POINTS(NPOINTS)
    
          CALL XDrawLines(DPY, PIXMAP_ID, GC_PIXMAP, POINTS,NPOINTS,
      +                           CoordModePrevious)
    
    
          CALL XNextEvent(DPY, EVENT)
    
    The rest of the program compiles and links quite happily and
    it  runs up until these calls which then produce the segmentation
    error.
    
    Any ideas
    
    regards Mark

T.RTitleUserPersonal
Name
DateLines
857.1STAR::BRANDENBERGSi vis pacem para bellumWed May 31 1989 09:0610
    
    Unfortunately, I don't have a Pmax so I can't say for certain, but I
    assume f77 on this box uses pass-by-reference as the default argument
    passing mechanism.  If you're using the C Xlib bindings as the code
    suggests, you'll need to pass-by-value most scalar arguments, such as
    DPY, NPOINTS, PIXMAP_ID, GC_PIXMAP, CoordModePrevious, etc., or use
    some jacket routines for Xlib (supplied perhaps?).
    
    						m