X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Nicholas Sherlock Subject: Using rand_r Date: Thu, 14 May 2009 17:27:49 +1200 Lines: 19 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051201 Thunderbird/1.5 Mnenhy/0.7.3.0 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Hey everyone, I'm trying to use the function rand_r with gcc-4 in Cygwin 1.7, all my packages are up to date. It's supposed to be defined in stdlib.h, and I can see it there. But if I compile a program which uses it, I get: warning: implicit declaration of function 'rand_r'. The reason seems to be the check for #ifndef __STRICT_ANSI__ in stdlib.h. Even though I'm compiling with -std=c99, __STRICT_ANSI__ still gets declared, so the definition of rand_r is unavailable. This seems to be the same problem stated here: http://sourceware.org/ml/newlib/2007/msg00783.html Is this a bug or is rand_r supposed to be unavailable with C99? Cheers, Nicholas Sherlock -- 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/