bugGNU Screen - Bugs: bug #27990, compile error in misc.c with Sun...

 
 

bug #27990: compile error in misc.c with Sun Studio 12 on Solaris 10

Submitter:  None
Submitted:  Tue 10 Nov 2009 04:49:18 PM UTC
   
 
Category:  Build/Install Severity:  3 - Normal
Priority:  * 5 - Normal Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Release:  None
Fixed Release:  4.1.0 Planned Release:  None
Work Required:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 27 May 2011 11:15:49 AM UTC, comment #2: 

Just to report that I encountered this issue with 4.0.3 on Solaris 10.

Frankie Fisher <frankster>
Sun 20 Dec 2009 06:47:24 AM UTC, comment #1: 

Fixed in 2cc00bf4d858ce36ff80b51560a795fb48303228.

Sadrul Habib Chowdhury <sadrul>
Group administrator
Tue 10 Nov 2009 04:49:18 PM UTC, original submission:  

Version is 4.0.1; I chose "none" since it wasn't available from the drop down.

Error is a call to "setenv" with incorrect number of parameters.

"misc.c", line 693: prototype mismatch: 2 args passed, 3 expected
cc: acomp failed for misc.c

After an examination of the file, I found that the call to setenv was wrong for this environment.

A bit of web searching later, and I found a related fix for a previous version of screen.

The fix I found was at:

http://mail-index.netbsd.org/pkgsrc-bugs/2005/12/10/0000.html

Here's the error the submitter encountered, along with the fix:

-----------------
cc -c -I. -I.    -O -xtarget=ultra2 -xarch=v8plusa misc.c
"misc.c", line 619: prototype mismatch: 2 args passed, 3 expected
cc: acomp failed for misc.c
* Error code 2

>Fix:

# /usr/include/stdlib.h
    183 #if defined(_EXTENSIONS_) || \
    184     (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
    185     defined(_XPG6)
    186 extern int posix_openpt(int);
    187 extern int setenv(const char , const char , int);
    188 extern int unsetenv(const char *);
    189 #endif
/usr/pkgsrc/misc/screen# cat patches/patch-aq
--- misc.c.orig Fri Dec  9 09:36:20 2005
+++ misc.c      Fri Dec  9 09:40:23 2005
@@ -613,7 +613,9 @@
    */
 # endif /* NEEDSETENV */
 #else /* USESETENV */
-# if defined(linux) || defined(_convex_) || (BSD >= 199103)
+# if defined(linux) || defined(_convex_) || (BSD >= 199103) \
+  || defined(_EXTENSIONS_) || defined(_XPG6) \
+  || (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
   setenv(var, value, 1);
 # else
   setenv(var, value);

cc: acomp failed for misc.c

--------------------------
And the relevant portion is:

-# if defined(linux) || defined(_convex_) || (BSD >= 199103)
+# if defined(linux) || defined(_convex_) || (BSD >= 199103) \
+  || defined(_EXTENSIONS_) || defined(_XPG6) \
+  || (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))

That is, add two more lines of tests to the if the #if that determines which version of setenv the environment provides.

I made that change by hand at the appropriate location in my version of misc.c (around line 690 or so) and it built.


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by frankster (Posted a comment)
  • -email is unavailable- added by sadrul (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-12-20 sadrul StatusNone Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.1.0

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code