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

Submitted by:  None
Submitted on:  Tue 10 Nov 2009 04:49:18 PM UTC  
 
Category: Build/InstallSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedRelease: None
Fixed Release: 4.1.0Planned Release: None
Work Required: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 20 Dec 2009 06:47:24 AM UTCsadrulStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.1.0

    Back to the top


    Powered by Savane 3.1-cleanup