#337340 [PR28319] sentinel attribute should support non-NULL sentinels

Package:
gcc
Source:
gcc-defaults
Description:
GNU C compiler
Submitter:
Josh Triplett
Date:
2015-04-18 17:51:05 UTC
Severity:
wishlist
#337340#5
Date:
2005-11-04 00:31:30 UTC
From:
To:
The sentinel attribute tells GCC to ensure that the argument list of a
variadic function always ends with a final NULL argument.  It should be
possible to use this attribute for a variadic function where the
sentinel is some constant other than NULL, as long as the value of the
constant can be determined at compile time and supplied as a parameter
to the sentinel attribute.

- Josh Triplett

#337340#10
Date:
2005-11-04 08:57:50 UTC
From:
To:
Josh Triplett <josh@psas.pdx.edu> writes:

Does this really occur frequently enough to be worth the trouble? Can
you name a few libraries that do this?

#337340#15
Date:
2005-11-04 09:31:44 UTC
From:
To:
Falk Hueffner wrote:

The particular case which prompted this bug report was a parsing engine,
which uses a variadic function to construct grammar rules consisting of
a start state, a character, a next state, and a list of actions,
terminated by the action LastAction (an enum constant equal to -1).
Predefined actions are negative numbers to avoid conflict with
user-defined actions which are positive numbers; starting user-defined
states at 0 rather than 1 allows the user to simply declare the states
in an enum (enum { ThisAction, ThatAction, ... } Actions;), without the
additional gotcha of having to set the first item to 1 to avoid conflict
with an arbitrarily-valued 0 sentinel.

I just finished finding an extremely non-obvious bug in which one
particular rule in a long list of rules was not terminated by
LastAction.  I was able to find it with valgrind at runtime, but this is
exactly the kind of thing that could be caught at compile time by the
sentinel check.

The original mail to the gcc list about implementation of the sentinel
attribute suggested that the ability to specify a different sentinel
value could be useful and could be added later after the initial
implementation was in place.

- Josh Triplett

#337340#32
Date:
2015-04-18 17:37:41 UTC
From:
To:
Lieber Bewerber,

die Arbeitsagentur stellt Ihnen nachfolgend eine interessante Tätigkeit in einem internationalen Team im Home-office Bereich vor, ohne Fahrtkosten, ohne Anfahrt, ohne Stau:

Wir schaffen qualitative und attraktive Stellen auch auf dem Land europaweit und bieten gleichzeitig hochwertige Qualität für unsere Kunden.

Ab sofort suchen wir:
Kollegen (m/w) für den Support im Home-office in der Abteilung Telekommunikation und Büroarbeit

Ihre Aufgaben wären:

- Unterlagen empfangen, bearbeiten und weiterleiten
- Dokumente kopieren/einscannen
- Mails beantworten
- Arbeit im Home Office in freien Zeiteinteilung
- Umgang mit zur Verfügung gestellten Büroausstattungen

Anforderungen an Sie:

- Unproblematischer Umgang mit E-mail, PC und Internet
- Deutsch fließend, Fremdsprachen sind vorteilhaft
- erfolgsorientiertes Arbeiten im Team
- Genauigkeit und Zielstrebigkeit

Wir bieten Ihnen eine Stelle in Festanstellung oder als Freiberufler mit einem Stundenlohn von 20 € Brutto in der Stunde in selbständigen Arbeitsweise und einer modernen Beschäftigungsform, sowie eine abwechslungsreiche Tätigkeit ohne Arbeitsweg mit flexiblen Arbeitszeiten.

Es werden keine Fachkenntnisse vorausgesetzt. Die Einarbeitung findet schrittweise durch professionelle Mitarbeiten statt. Die benötigte technische Ausstattung stellen wir Ihnen kostenlos zur Verfügung. Die Arbeitsstelle kann gerne nebenberuflich ausgeführt werden sowie von Rentnern und Hausfrauen.

Sie sind offen für flexible Arbeitszeitmodelle und die Arbeit im Home Office? Wenn wir Ihr Interesse geweckt haben, senden Sie uns Ihre Bewerbung per E-Mail an: FRODOQUE696@post.com


Ihre persönlichen Daten behandeln wir vertraulich.

Mit freundlichen Grüßen

Meyer LTD