From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71986 invoked by alias); 16 Sep 2019 16:14:27 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 71791 invoked by uid 89); 16 Sep 2019 16:14:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*RU:sk:sonic31, H*F:D*att.net, editor, H*r:sk:sonic31 X-HELO: sonic313-16.consmr.mail.bf2.yahoo.com Received: from sonic313-16.consmr.mail.bf2.yahoo.com (HELO sonic313-16.consmr.mail.bf2.yahoo.com) (74.6.133.126) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Sep 2019 16:14:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=att.net; s=s1024; t=1568650464; bh=dGI9wYZp67UYRpCJpZ4mcbiFv/Wx9zPoiUzrAZEmWQA=; h=Date:From:Subject:To:From:Subject; b=0wp0nG1g3ehRCcPmS/25i7k35b/h1dXG8nqNj7BxIUXBo7OaammXg57gwHhoTcSFgF5yeATxvun34ivEfUoFCsn1CaFs0FjPGluV8eucW7ubLf5hXFf/e8KOg5rxgItSM5QppIaKswWUSqOZOujOUXmZlZiJxw7wi/GRfBtQbEQ= Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.bf2.yahoo.com with HTTP; Mon, 16 Sep 2019 16:14:24 +0000 Received: by smtp425.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID e4a78928ff9588772a46510da1a7ad65; Mon, 16 Sep 2019 16:14:20 +0000 (UTC) Date: Mon, 16 Sep 2019 16:14:00 -0000 From: Steven Abner Subject: General practices To: newlib@sourceware.org Message-Id: <1568650458.19828.0@smtp.mail.att.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-IsSubscribed: yes X-SW-Source: 2019/txt/msg00560.txt.bz2 Need some help: I've gone through several of libgloss crt0 files, normally create code on the mac, love the editor! Seen that Newlib has switched to 'FreeBSD' style FILE unit. With the basic intro out of the way... the question is: from _start to main(), the normal 'return' from main() dumps you back to _start from which I assume Newlib has a standard expected termination of the process. Correct assumption? And is this expectation that of calling the 'exit' function? The reason for this question is that the APPLE FreeBSD style does call 'exit' which allows for clean up, such as flushing files, calling atexit(), etc. and lunix does not allow for such a clean up using 'return' from main(). Maybe I just misunderstand the 'C' process? Thanks in advance, and hopefully down the road I can offer up a smaller, embedded type FILE unit, if I can work out the return vs. exit clean up. Not sure people want to stop using return for exit just to flush stdout. Steve