delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/02/27/19:08:57

X-Spam-Check-By: sourceware.org
Date: Mon, 27 Feb 2006 19:08:45 -0500 (EST)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Mary Cuper <MCuper AT gmx DOT net>
cc: cygwin AT cygwin DOT com
Subject: Re: right-hand operand of comma has no effect
In-Reply-To: <10356.1141074476@www017.gmx.net>
Message-ID: <Pine.GSO.4.63.0602271859280.22191@access1.cims.nyu.edu>
References: <10356 DOT 1141074476 AT www017 DOT gmx DOT net>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mon, 27 Feb 2006, Mary Cuper wrote:

> I want to set the baudrate of my /dev/ttyS0 with:
>
> cfsetispeed(&options, B9600);
> cfsetospeed(&options, B9600);
>
> but always get:
>
> "Warning: right-hand operand of comma has no effect".
>
> With linux the code functions!

Cygwin uses newlib, which defines cfsetospeed as a macro that expands to
(foo, 0).  "foo" is the part that does the actual work.  g++ is simply
warning you that the "0" has no effect in void context (since you're
throwing away the return code).  Linux uses glibc, which defines
cfsetospeed as a real function.

You can safely ignore this warning.  If you want to get rid of it, cast
the return value to void, i.e.,

(void)cfsetospeed(&options, B9600);

or use the result in some expression.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019