From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60400 invoked by alias); 13 Jul 2017 19:30:58 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 59609 invoked by uid 89); 13 Jul 2017 19:30:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=bz0815tirolcom, bz0815@tirol.com, HContent-Language:en-CA, Hx-spam-relays-external:sk:smtp-ou X-HELO: smtp-out-no.shaw.ca Received: from smtp-out-no.shaw.ca (HELO smtp-out-no.shaw.ca) (64.59.134.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Jul 2017 19:30:56 +0000 Received: from [192.168.1.100] ([24.64.240.204]) by shaw.ca with SMTP id Vjp7dyYT8rztEVjp8dMp4b; Thu, 13 Jul 2017 13:30:54 -0600 X-Authority-Analysis: v=2.2 cv=M/89E24s c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=IkcTkHD0fZMA:10 a=nXpHVBCWAAAA:8 a=8pif782wAAAA:8 a=eNdypJ0LU00hLmjAdYoA:9 a=QEXdDO2ut3YA:10 a=ef1U3j1GZOLCPeCgkYM6:22 Reply-To: Brian.Inglis@SystematicSw.ab.ca Subject: Re: Pthreads: Prototypes missing if -std=c11 To: cygwin@cygwin.com References: From: Brian Inglis Message-ID: Date: Thu, 13 Jul 2017 19:30:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfNKAk1/Lv1TM8FDzyOI/tTKPZtK2z5QY5Nb5N6VhGC1U5Qh9oLYk2LTDb90inejlmKCVXULhYgWF08htO4Om964G3qG8l57KHuvZq+NN/KeVdRCtp8Fq RypiBkmCkQGLWZCLnTE47V4PACetFS5PPCmXMmNFyswwkkHmT02T6c1KbqHuWQuWf/LdUbUYMvZCFQ== X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00225.txt.bz2 On 2017-07-13 09:36, bz0815@tirol.com wrote: >> On 2017-07-12 11:15, bz0815@tirol.com wrote: >>> gcc does not recognize some functions from pthread.h if option -std=c11 >>> is used: >> >> Exactly, and the same happens with glibc. When you use -std=c*, that means >> you are declaring strict ISO C, and all extensions are disabled by default >> unless explicitly enabled (e.g. with -D_POSIX_C_SOURCE=200112L). >> >> If you are not compatible with ISO C, then you should be using >> -std=gnu* instead. > Many thanks for the info, Yaakov. Accoring to the manual -std determines the > language standard and c11 means ISO C11, the 2011 revision of the ISO C > standard. Howevery, I find no restriction on POSIX in ISO/IEC 9899:2011. So > why should -std=c11 have an influence on Pthreads? Am I missing something? ISO/IEC 9899 specifies the features and facilities that shall or may be provided by all standard conforming freestanding or hosted implementations. It considers proposals from stakeholders for new language and library features based on available implementations. Threading is optional in standards conforming implementations: conforming programs must compile cleanly if the feature is not available, and use only the facilities declared in threads.h. See https://en.wikipedia.org/wiki/C11_(C_standard_revision)#Optional_features POSIX specifies common features and facilities that shall or may be provided by one class of hosted implementations, with additional requirements to those specified for standard conforming implementations. POSIX does not provide threads.h but does provide pthreads.h, so you have a choice, depending on whether you want to be strictly conforming or support POSIX. See or search for Linux glibc man 7 feature_test_macros for more info about macros and values. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple