Path: ...!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!cleanfeed3-b.proxad.net!nnrp3-2.free.fr!not-for-mail Newsgroups: fr.comp.lang.c From: Thomas Nemeth Subject: Re: =?UTF-8?Q?D=C3=A9claration?= extern References: <657f1dd4$0$10079$426a74cc@news.free.fr> Organization: Discheveled Reply-To: Thomas Nemeth X-troll: slrn est mieux que gnus, vim mieux que emacs User-Agent: slrn/1.0.3 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 18 Dec 2023 13:25:57 GMT Lines: 43 Message-ID: <65804865$0$2579$426a74cc@news.free.fr> NNTP-Posting-Date: 18 Dec 2023 14:25:57 CET NNTP-Posting-Host: 82.64.171.187 X-Trace: 1702905957 news-3.free.fr 2579 82.64.171.187:45324 X-Complaints-To: abuse@proxad.net Bytes: 2565 Le 18-12-2023, Thierry Pinelli a écrit : > Le 17/12/2023 à 22:16, Olivier Miakinen a écrit : >> Le 17/12/2023 21:57, je répondais à Thomas Nemeth : >>> >>> Je n'ai malheureusement pas de pointeur vers une doc officielle à te donner, >>> alors si c'est ça que tu cherches je suis désolé de ne pas pouvoir t'aider. >> >> J'ai trouvé la doc de référence. Ils ne parlent absolument pas du mot-clé >> extern dans les déclarations de fonctions, et celui-ci n'est utilisé dans >> aucun exemple : >> >> En effet. Par contre en suivant le lien "external linkage", on tombe sur : https://en.cppreference.com/w/c/language/storage_duration qui dit « The extern specifier specifies static storage duration (unless combined with _Thread_local(until C23)thread_local(since C23)) (since C11) and external linkage. It can be used with function and object declarations in both file and block scope (excluding function parameter lists). » Mais est ajoutée la précision : « If no storage-class specifier is provided, the defaults are: extern for all functions [...] » > par contre ici-même on en parle : > > https://www.geeksforgeeks.org/understanding-extern-keyword-in-c/ Qui précise : « It turns out that when a function is declared or defined, the extern keyword is implicitly assumed. » Merci à tous. Thomas. -- BOFH excuse #28: CPU radiator broken.