WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] With -D_FORTIFY_SOURCE=2 (which is used in the Fedora bu

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] With -D_FORTIFY_SOURCE=2 (which is used in the Fedora buildroot), gcc has certain defines for functions like read() to check that things are done right.
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Mon, 18 Apr 2005 20:48:40 +0000
Delivery-date: Tue, 19 Apr 2005 01:03:31 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1313, 2005/04/18 21:48:40+01:00, iap10@xxxxxxxxxxxxxxxxxxxxx

        With -D_FORTIFY_SOURCE=2 (which is used in the Fedora buildroot), gcc 
has certain defines for functions like read() to check that things are done 
right.
        
        This trips up these function pointers, and gcc becomes unhappy.
        Adding parens around the function prevents gcc from expanding read to 
the macro it is defined to internally, and makes things compile again.
        
        Signed-off-by: Rik van Riel <riel@xxxxxxxxxx>
        



 iostream.h |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)


diff -Nru a/tools/libxutil/iostream.h b/tools/libxutil/iostream.h
--- a/tools/libxutil/iostream.h 2005-04-18 21:03:47 -04:00
+++ b/tools/libxutil/iostream.h 2005-04-18 21:03:47 -04:00
@@ -114,7 +114,7 @@
         result = -EINVAL;
         goto exit;
     }
-    result = stream->methods->read(stream, buf, n);
+    result = (stream->methods->read)(stream, buf, n);
     if(result > 0){
         stream->read += result;
     }
@@ -139,7 +139,7 @@
         result = -EINVAL;
         goto exit;
     }
-    result = stream->methods->write(stream, buf, n);
+    result = (stream->methods->write)(stream, buf, n);
     if(result > 0){
         stream->written += result;
     }
@@ -157,7 +157,7 @@
     if(stream->closed){
         result = IOSTREAM_EOF;
     } else if(stream->methods->flush){
-        result = stream->methods->flush(stream);
+        result = (stream->methods->flush)(stream);
         if(result < 0) result = IOSTREAM_EOF;
     }
     return result;
@@ -171,7 +171,7 @@
 static inline int IOStream_error(IOStream *stream){
     int err = 0;
     if(stream->methods && stream->methods->error){
-       err = stream->methods->error(stream);
+       err = (stream->methods->error)(stream);
     }
     return err;
 }
@@ -184,7 +184,7 @@
 static inline int IOStream_close(IOStream *stream){
     int err = 1;
     if(stream->methods && stream->methods->close){
-        err = stream->methods->close(stream);
+        err = (stream->methods->close)(stream);
         stream->closed = 1;
     }
     return err;
@@ -205,10 +205,10 @@
  */
 static inline void IOStream_free(IOStream *stream){
     if(!stream->closed && stream->methods && stream->methods->close){
-        stream->methods->close(stream);
+        (stream->methods->close)(stream);
     }
     if(stream->methods && stream->methods->free){
-        stream->methods->free(stream);
+        (stream->methods->free)(stream);
     }
     *stream = (IOStream){};
     deallocate(stream);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] With -D_FORTIFY_SOURCE=2 (which is used in the Fedora buildroot), gcc has certain defines for functions like read() to check that things are done right., BitKeeper Bot <=