A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-September/068982.html below:

[Python-Dev] Pep 353: Py_ssize_t advice

[Python-Dev] Pep 353: Py_ssize_t advice [Python-Dev] Pep 353: Py_ssize_t adviceDavid Hopwood david.nospam.hopwood at blueyonder.co.uk
Sat Sep 23 22:00:29 CEST 2006
Martin v. Löwis wrote:
> David Abrahams schrieb:
> 
>>(C++ allows restating of typedefs; if C allows it, that should be
>>something like):
> 
> C also allows this; [...]

This is nitpicking, since you agreed the change to the PEP, but are you
sure that C allows this?

From C99 + TC1 + TC2 (http://www.open-std.org/JTC1/SC22/WG14/www/standards):

# 6.2.2  Linkages of identifiers
#
# 6  The following identifiers have no linkage: an identifier declared
#    to be anything other than an object or a function; [...]

(i.e. typedef identifiers have no linkage)

# 6.7  Declarations
#
# Constraints
# 3  If an identifier has no linkage, there shall be no more than one
#    declaration of the identifier (in a declarator or type specifier)
#    with the same scope and in the same name space, except for tags as
#    specified in 6.7.2.3.

# 6.7.2.3  Tags
#
# Constraints
# 1  A specific type shall have its content defined at most once.

(There is nothing else in 6.7.2.3 that applies to typedefs.)

Since 6.7 (3) and 6.7.2.3 (1) are constraints, I read this as saying that
a C99 implementation must produce a diagnostic if a typedef is redeclared
in the same scope. If the program is run despite the diagnostic, its behaviour
is undefined.

Several C compilers I've used in the past have needed the idempotence guard
on typedefs, in any case.

-- 
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4