473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Utility to convert complex declarations into, well, lol, plain-text

Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?
Apr 29 '07 #1
11 1871
In article <n6********************************@4ax.com>,
nospam <no****@nospam.comwrote:
>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.
You mean something like the old 'cdecl' exercise?
>Is there a executable version for wintel platforms?

You could compile it yourself.

http://linux.maruhn.com/sec/cdecl.html
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
Apr 29 '07 #2
nospam <no****@nospam.comwrites:
Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?
This is in the FAQ.

Section 18. Tools and Resources

18.1: I need: A: Look for programs (see also
question 18.16) named:

a C cross-reference cflow, cxref, calls, cscope,
generator xscope, or ixfw

a C beautifier/pretty- cb, indent, GNU indent, or
printer vgrind

a revision control or CVS, RCS, or SCCS
configuration management
tool

a C source obfuscator obfus, shroud, or opqcp
(shrouder)

a "make" dependency makedepend, or try cc -M or
generator cpp -M

tools to compute code ccount, Metre, lcount, or csize,
metrics or see URL http://www.qucis.queensu.ca/
Software-Engineering/Cmetrics.html ;
there is also a package sold
by McCabe and Associates

a C lines-of-source this can be done very
counter crudely with the standard
Unix utility wc, and
somewhat better with
grep -c ";"

a C declaration aid check volume 14 of
(cdecl) comp.sources.unix (see
question 18.16) and K&R2

a prototype generator see question 11.31

a tool to track down
malloc problems see question 18.2

a "selective" C
preprocessor see question 10.18

language translation see questions 11.31 and
tools 20.26

C verifiers (lint) see question 18.7

a C compiler! see question 18.3

(This list of tools is by no means complete; if you know of
tools not mentioned, you're welcome to contact this list's
maintainer.)

--
"I hope, some day, to learn to read.
It seems to be even harder than writing."
--Richard Heathfield
Apr 29 '07 #3

"Ben Pfaff" <bl*@cs.stanford.eduwrote in message
news:87************@blp.benpfaff.org...
nospam <no****@nospam.comwrites:
>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?

This is in the FAQ.

Section 18. Tools and Resources
What he wants is something like

input:
y = 1/((x + 1) * ( x + 2) + 3);
output:
y = (x+1) * (x+2);
y += 3;
y = 1/y;

Now the snag is more obvious. We need to insert a test before line 3.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Apr 29 '07 #4
"Malcolm McLean" <re*******@btinternet.comwrites:
"Ben Pfaff" <bl*@cs.stanford.eduwrote in message
news:87************@blp.benpfaff.org...
>nospam <no****@nospam.comwrites:
>>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?

This is in the FAQ.

Section 18. Tools and Resources
What he wants is something like

input:
y = 1/((x + 1) * ( x + 2) + 3);
output:
y = (x+1) * (x+2);
y += 3;
y = 1/y;

Now the snag is more obvious. We need to insert a test before line 3.
He asked about declarations, not statements.

Your guess about what he actually wants may well be correct, but if so
then he also needs to understand the terminology.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Apr 29 '07 #5
On Sat, 28 Apr 2007 18:42:33 -0700, Ben Pfaff <bl*@cs.stanford.edu>
wrote:
>nospam <no****@nospam.comwrites:
>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?

This is in the FAQ.

Section 18. Tools and Resources

18.1: I need: A: Look for programs (see also
question 18.16) named:
> (This list of tools is by no means complete; if you know of
tools not mentioned, you're welcome to contact this list's
maintainer.)
And some of my favorites:

18.1: I need: A: Look for programs
named:

A static source A. PC-lint,
code analyzer. http://www.gimpel.com/

A code coverage A. BullseyeCoverage,
tool. http://www.bullseye.com/

A diff utility. A. BeyondCompare,
http://www.scootersoftware.com/

Best regards
--
jay
Apr 29 '07 #6
In article <ur******************************@bt.com>,
Malcolm McLean <re*******@btinternet.comwrote:
>input:
y = 1/((x + 1) * ( x + 2) + 3);
output:
y = (x+1) * (x+2);
y += 3;
y = 1/y;

Now the snag is more obvious. We need to insert a test before line 3.
Under what conditions would you expect the test to fail?
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca
From that simple premise, you have managed to demonstrate that, in the lab in
which I had chemistry classes about 25 years ago, the teacher's lab stool was
intelligent. --Richard Heathfield in comp.programming
Apr 29 '07 #7
"Malcolm McLean" <re*******@btinternet.comwrites:
"Ben Pfaff" <bl*@cs.stanford.eduwrote in message
news:87************@blp.benpfaff.org...
>nospam <no****@nospam.comwrites:
>>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?

This is in the FAQ.

Section 18. Tools and Resources
What he wants is something like

input:
y = 1/((x + 1) * ( x + 2) + 3);
output:
y = (x+1) * (x+2);
y += 3;
y = 1/y;
He asked about declarations, not expressions.
--
Comp-sci PhD expected before end of 2007
Seeking industrial or academic position *outside California* in 2008
Apr 29 '07 #8
In article <f1**********@rumours.uwaterloo.ca>,
Dave Vandervies <dj******@caffeine.csclub.uwaterloo.cawrote:
>In article <ur******************************@bt.com>,
Malcolm McLean <re*******@btinternet.comwrote:
>>input:
y = 1/((x + 1) * ( x + 2) + 3);
output:
y = (x+1) * (x+2);
y += 3;
y = 1/y;
>>Now the snag is more obvious. We need to insert a test before line 3.
>Under what conditions would you expect the test to fail?
I seem to recall that C99 has complex number support ;-)
--
I was very young in those days, but I was also rather dim.
-- Christopher Priest
Apr 29 '07 #9
Ben Pfaff <bl*@cs.stanford.eduwrote:
nospam <no****@nospam.comwrites:
>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?
This is in the FAQ.
The FAQ doesn't answer the question. In particular (something to get used
to in case you decide to learn how to do research), it's citing information
that's been obsolete for several years.
Section 18. Tools and Resources
18.1: I need: A: Look for programs (see also
question 18.16) named:
....
a C declaration aid check volume 14 of
(cdecl) comp.sources.unix (see
question 18.16) and K&R2
comp.sources.unix is defunct, has been for a long time - shortly after
the material for the FAQ was scraped out of stray places.

For grins, read 18.16, which was apparently last updated roughly 10 years ago.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
May 3 '07 #10
Thomas Dickey <di****@saltmine.radix.netwrites:
Ben Pfaff <bl*@cs.stanford.eduwrote:
>nospam <no****@nospam.comwrites:
>>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?
>This is in the FAQ.

The FAQ doesn't answer the question.
It says to get cdecl from comp.sources.unix. You can still do
that, with Google Groups. Or, if you don't want to do that, you
can easily search the web for "cdecl", once you know that the
utility has that name.

There's no need for the FAQ to hold the reader's hand. Its
readers are, after all, programmers, who should be able to use
some amount of logical reasoning.
--
Ben Pfaff
http://benpfaff.org
May 3 '07 #11
Ben Pfaff <bl*@cs.stanford.eduwrote:
Thomas Dickey <di****@saltmine.radix.netwrites:
>Ben Pfaff <bl*@cs.stanford.eduwrote:
>>nospam <no****@nospam.comwrites:
>>>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?
>>This is in the FAQ.

The FAQ doesn't answer the question.
It says to get cdecl from comp.sources.unix. You can still do
It says several things. But it doesn't answer the question, as
noted above ("executable"...).
that, with Google Groups. Or, if you don't want to do that, you
can easily search the web for "cdecl", once you know that the
utility has that name.
fortunately ten-year old information is not entirely stale.
But it's not the FAQ which makes it useful (obsolete references
to newsgroups, ftp sites, etc).
There's no need for the FAQ to hold the reader's hand. Its
readers are, after all, programmers, who should be able to use
some amount of logical reasoning.
some of them are programmers. But "logical reasoning" is an unreasonable
inference.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
May 3 '07 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below....
134
by: James A. Donald | last post by:
I am contemplating getting into Python, which is used by engineers I admire - google and Bram Cohen, but was horrified to read "no variable or argument declarations are necessary." Surely that...
29
by: Mark B | last post by:
We have an Access app (quite big) at www.orbisoft.com/download. We have had requests by potential users to have it converted to an SQL version for them since there corporate policy excludes them...
1
by: hristo | last post by:
Heya, can i ask u a q about VB.NET I v found Microsoft Visual Studio .NET in my PC, should i install also Visual Basic .NET Resource Kit? Heya, First of all pardon me my ignorance. I am...
12
by: noor.fatma | last post by:
Hi, recently I attended a test on C where I was asked to declare the following declarations in one line. void ** ( *p )(int *, char *); int *a; how should i do this shall i use typedef...
22
by: David Mathog | last post by:
One thing that keeps coming up in this forum is that standard C lacks many functions which are required in a workstation or server but not possible in an embedded controller. This results in a...
4
by: 2803stan | last post by:
Hi, I need to know if my regular relational database, now in DB2 v9.1 can be transformed to an XML database easily? The data can very easily be represented in XML, but can I convert a regular...
9
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
Recently, there was a Linux program distributed as source code, and it compiled fine on the majority of systems. However on some systems, it failed to compile. On some of these systems, people were...
37
by: Phlip | last post by:
1230987za wrote: Kanze is a classically-trained "unit tester". In some circles "unit" is a QA concept - specifically, if a test fails, you only need to inspect one unit. So "units" are...
9
by: void main | last post by:
I'm rather new to complex numbers in C and was wondering, how do I initialize a complex variable properly if the imaginary part is 0. I tried -------- #include <complex.h> float complex c...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.