X-Spam-Check-By: sourceware.org Date: Mon, 27 Feb 2006 19:08:45 -0500 (EST) From: Igor Peshansky Reply-To: cygwin AT cygwin DOT com To: Mary Cuper 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: References: <10356 DOT 1141074476 AT www017 DOT gmx DOT net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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/