Deutsch   English   Français   Italiano  
<vv3dr1$2idge$1@paganini.bofh.team>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!newsfeed.bofh.team!paganini.bofh.team!not-for-mail
From: antispam@fricas.org (Waldek Hebisch)
Newsgroups: comp.lang.c
Subject: Re: Regarding assignment to struct
Date: Fri, 2 May 2025 21:35:31 -0000 (UTC)
Organization: To protect and to server
Message-ID: <vv3dr1$2idge$1@paganini.bofh.team>
References: <vv338b$16oam$1@dont-email.me>
Injection-Date: Fri, 2 May 2025 21:35:31 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="2700814"; posting-host="WwiNTD3IIceGeoS5hCc4+A.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
X-Notice: Filtered by postfilter v. 0.9.3

Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
> Back in the days of K&R, Kernighan and Ritchie published an addendum
> to the "C Reference Manual" titled "Recent Changes to C" (November 1978)
> in which they detailed some differences in the C language post "The
> C Programming Language".
> 
> The first difference they noted was that
>   "Structures may be assigned, passed as arguments to functions, and
>    returned by functions."
> 
> From what I can see of the ISO C standards, the current C language
> has kept these these features. However, I don't see many C projects
> using them.
> 
> I have a project in which these capabilities might come in handy; has
> anyone had experience with assigning to structures, passing them as
> arguments to functions, and/or having a function return a structure?

Typically this is fine.  However, in sdcc-4.2 manual one can find
the following statement:

: Deviations from standard compliance:
:   structures and unions cannot be passed as function parameters
:   and cannot be a return value from a function,....

-- 
                              Waldek Hebisch