GNU bug report logs - #7838
24.0.50; warning in lib-src/emacsclient.c:1235 in Mac OS X

Previous Next

Packages: emacs, ns;

Reported by: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>

Date: Thu, 13 Jan 2011 22:17:02 UTC

Severity: minor

Tags: patch

Found in version 24.0.50

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7838 in the body.
You can then email your comments to 7838 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7838; Package emacs. (Thu, 13 Jan 2011 22:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Peter Dyballa <Peter_Dyballa <at> Freenet.DE>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 13 Jan 2011 22:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; warning in lib-src/emacsclient.c:1235 in Mac OS X
Date: Thu, 13 Jan 2011 23:16:20 +0100
Hello!

From *compilation* buffer:

	..../lib-src/emacsclient.c: In function ‘set_local_socket’:
	..../lib-src/emacsclient.c:1235: warning: passing argument 2 of  
‘confstr’ discards qualifiers from pointer target type
	Multiple include guards may be useful for:
	../src/s/darwin.h

From the source:

 1222	    if (default_sock)
 1223	      {
 1224		tmpdir = egetenv ("TMPDIR");
 1225		if (!tmpdir)
 1226	          {
 1227	#ifdef DARWIN_OS
 1228	#ifndef _CS_DARWIN_USER_TEMP_DIR
 1229	#define _CS_DARWIN_USER_TEMP_DIR 65537
 1230	#endif
 1231	            size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL,  
(size_t) 0);
 1232	            if (n > 0)
 1233	              {
 1234	                tmpdir = alloca (n);
 1235	                confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
 1236	              }
 1237	            else
 1238	#endif
 1239	              tmpdir = "/tmp";
 1240	          }


In GNU Emacs 24.0.50.1 (powerpc-apple-darwin9.8.0, X toolkit, Xaw3d  
scroll bars)
 of 2011-01-13 on localhost
Windowing system distributor `The X.Org Foundation', version  
11.0.10903000
configured using `configure  '--without-sound' '--without-dbus' '-- 
without-pop' '--without-gconf' '--with-x-toolkit=athena' '--x- 
libraries=/usr/X11/lib' '--x-includes=/usr/X11/include' '--enable- 
locallisppath=/Library/Application Support/Emacs/calendar24:/Library/ 
Application Support/Emacs' 'CFLAGS=-g -H -pipe -fPIC -fno-common - 
mcpu=7450 -mtune=7450 -faltivec -fast' 'CPPFLAGS=-I/usr/local/include - 
idirafter /opt/local/include' 'LDFLAGS=-L/usr/local/lib -Wl,- 
dead_strip_dylibs' 'CC=gcc-4.2' 'CPP=cpp-4.2' 'PKG_CONFIG_PATH=/usr/ 
local/lib/pkgconfig:/usr/local/share/pkgconfig:/opt/local/lib/ 
pkgconfig:/opt/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/ 
pkgconfig:/usr/X11/share/pkgconfig''


--
Greetings

  Pete

Never be led astray onto the path of virtue





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7838; Package emacs. (Thu, 31 Mar 2011 17:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 7838 <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: 7838 <at> debbugs.gnu.org
Subject: Re: bug#7838: Acknowledgement (24.0.50;
	warning in lib-src/emacsclient.c:1235 in Mac OS X)
Date: Thu, 31 Mar 2011 19:26:06 +0200
Hello!

GCC 4.5.2 now reports:

.../emacs-24.0.50/lib-src/emacsclient.c: In Funktion »set_local_socket«:
.../emacs-24.0.50/lib-src/emacsclient.c:1251:17: Warnung: Übergabe des  
Arguments 2 von »confstr« entfernt Kennzeichner von Zeiger-Ziel-Typ
/usr/include/unistd.h:423:9: Anmerkung: expected »char *« but argument  
is of type »const char *«

 1238	    if (default_sock)
 1239	      {
 1240		tmpdir = egetenv ("TMPDIR");
 1241		if (!tmpdir)
 1242	          {
 1243	#ifdef DARWIN_OS
 1244	#ifndef _CS_DARWIN_USER_TEMP_DIR
 1245	#define _CS_DARWIN_USER_TEMP_DIR 65537
 1246	#endif
 1247	            size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL,  
(size_t) 0);
 1248	            if (n > 0)
 1249	              {
 1250	                tmpdir = alloca (n);
 1251	                confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
 1252	              }
 1253	            else
 1254	#endif
 1255	              tmpdir = "/tmp";
 1256	          }

And in /usr/include/unistd.h:

  414	__BEGIN_DECLS
  415	
  416	void	 _exit(int) __dead2;
  417	int	 access(const char *, int);
  418	unsigned int
  419		 alarm(unsigned int);
  420	int	 chdir(const char *);
  421	int	 chown(const char *, uid_t, gid_t);
  422	int	 close(int) __DARWIN_ALIAS_C(close);
  423	size_t	 confstr(int, char *, size_t) __DARWIN_ALIAS(confstr);
  424	char	*crypt(const char *, const char *);
  425	char	*ctermid(char *);


--
Greetings

  Pete

Without vi there is only GNU Emacs





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7838; Package emacs,ns. (Mon, 18 Jun 2012 03:02:02 GMT) Full text and rfc822 format available.

Message #11 received at 7838 <at> debbugs.gnu.org (full text, mbox):

From: Samuel Bronson <naesten <at> gmail.com>
To: Peter_Dyballa <at> Freenet.DE
Cc: 7838 <at> debbugs.gnu.org
Subject: Re: bug#7838: 24.0.50;
	warning in lib-src/emacsclient.c:1235 in Mac OS X
Date: Sun, 17 Jun 2012 22:58:21 -0400
The fix is simple:

=== modified file 'lib-src/emacsclient.c'
--- lib-src/emacsclient.c	2012-05-05 04:32:58 +0000
+++ lib-src/emacsclient.c	2012-06-17 18:00:58 +0000
@@ -1278,7 +1278,7 @@
             if (n > 0)
               {
 		tmpdir = tmpdir_storage = xmalloc (n);
-                confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
+                confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir_storage, n);
               }
             else
 #endif




Added tag(s) patch. Request was from Samuel Bronson <naesten <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 18 Jun 2012 20:23:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7838; Package emacs,ns. (Fri, 22 Jun 2012 21:03:02 GMT) Full text and rfc822 format available.

Message #16 received at 7838 <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Web.DE>
To: Samuel Bronson <naesten <at> gmail.com>
Cc: 7838 <at> debbugs.gnu.org
Subject: Re: bug#7838: 24.0.50;
	warning in lib-src/emacsclient.c:1235 in Mac OS X
Date: Fri, 22 Jun 2012 22:58:35 +0200
Am 18.06.2012 um 04:58 schrieb Samuel Bronson:

> The fix is simple:
> 
> === modified file 'lib-src/emacsclient.c'
> --- lib-src/emacsclient.c	2012-05-05 04:32:58 +0000
> +++ lib-src/emacsclient.c	2012-06-17 18:00:58 +0000
> @@ -1278,7 +1278,7 @@
>            if (n > 0)
>              {
> 		tmpdir = tmpdir_storage = xmalloc (n);
> -                confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
> +                confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir_storage, n);
>              }
>            else
> #endif


It indeed works!

--
Greetings

 Pete

Atheism is a non prophet organisation.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7838; Package emacs,ns. (Sun, 24 Jun 2012 09:48:01 GMT) Full text and rfc822 format available.

Message #19 received at 7838 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Samuel Bronson <naesten <at> gmail.com>
Cc: Peter_Dyballa <at> Freenet.DE, 7838 <at> debbugs.gnu.org
Subject: Re: bug#7838: 24.0.50;
	warning in lib-src/emacsclient.c:1235 in Mac OS X
Date: Sun, 24 Jun 2012 17:43:37 +0800
Samuel Bronson <naesten <at> gmail.com> writes:

> The fix is simple:
>
> === modified file 'lib-src/emacsclient.c'
> --- lib-src/emacsclient.c	2012-05-05 04:32:58 +0000
> +++ lib-src/emacsclient.c	2012-06-17 18:00:58 +0000
> @@ -1278,7 +1278,7 @@
>              if (n > 0)
>                {
>  		tmpdir = tmpdir_storage = xmalloc (n);
> -                confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
> +                confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir_storage, n);
>                }
>              else
>  #endif

Thanks, committed.




bug closed, send any further explanations to 7838 <at> debbugs.gnu.org and Peter Dyballa <Peter_Dyballa <at> Freenet.DE> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 24 Jun 2012 09:48:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 22 Jul 2012 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.