Following warnings are found in my application:
..../adm_std_mo_desc r.h:240: warning: non-static const member `const
struct std_tee_t std_mo::tee' in class without a constructor
..../adm_std_mo_desc r.h:244: warning: non-static const member `const
char *const std_mo::name' in class without a constructor
The header file looks as the following:
typedef struct std_tee {
const unsigned int size;
} std_tee_t;
typedef struct std_mo {
const std_tee_t tee;
const char* const name;
} std_mo_t;
I am wondering what the problem is. I tried to write a small test
program, but it compiles without such warning.
I am using gcc2.7.2 on Tornado/VxWorks.
Thanks a lot for your help.
Zhixin 6 4062
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 zh********@hotm ail.com wrote: Following warnings are found in my application:
.../adm_std_mo_desc r.h:240: warning: non-static const member `const struct std_tee_t std_mo::tee' in class without a constructor
[snip]
You don't have to look any further than this first error message.
Since the C language neither has the classes nor the constructors that
your compiler is complaining about, you are not compiling your code with
a C compiler.
Use a C compiler on your C code, and see if that fixes your problem
- --
Lew Pitcher, IT Specialist, Enterprise Data Systems
Enterprise Technology Solutions, TD Bank Financial Group
(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
iD8DBQFCsF4EagV FX4UWr64RAomyAK DGH2QM7fbwOZqLY cZscESL/a8XrgCgh8k/
roPJQZlxhN/lefoQjDoSK8g=
=LoVU
-----END PGP SIGNATURE-----
On Wed, 15 Jun 2005 07:49:51 -0700, zhixin_han wrote: Following warnings are found in my application:
.../adm_std_mo_desc r.h:240: warning: non-static const member `const struct std_tee_t std_mo::tee' in class without a constructor .../adm_std_mo_desc r.h:244: warning: non-static const member `const char *const std_mo::name' in class without a constructor
C doersn't have classes or constructirs, you appear to be trying to
compile your code with a C++ compiler. Solution: compile C code with a C
compiler.
....
I am using gcc2.7.2 on Tornado/VxWorks.
Compilers are often sensitive to the extension of the source filename.
Make sure it is .c rather than, sap, .cpp or .C
Lawrence zh********@hotm ail.com wrote: Following warnings are found in my application:
.../adm_std_mo_desc r.h:240: warning: non-static const member `const struct std_tee_t std_mo::tee' in class without a constructor .../adm_std_mo_desc r.h:244: warning: non-static const member `const char *const std_mo::name' in class without a constructor
The header file looks as the following:
typedef struct std_tee { const unsigned int size; } std_tee_t;
typedef struct std_mo { const std_tee_t tee; const char* const name; } std_mo_t;
I am wondering what the problem is. I tried to write a small test program, but it compiles without such warning.
I am using gcc2.7.2 on Tornado/VxWorks.
Thanks a lot for your help.
Zhixin
No such thing as a constructor, or a class, in C. Perhaps you want C++
or java.
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Common User Interface Services
M/S 2R-94 (206)544-5225
#! rnews 1963
Xref: xyzzy comp.lang.c:560 602
Newsgroups: comp.lang.c
Path: xyzzy!nntp
From: "Fred L. Kleinschmidt" <fred.l.kleinsc hmidt@nospam_bo eing.com>
Subject: Re: Methods to handle filename extensions?
X-Nntp-Posting-Host: xpc-ps-06.nw.nos.boein g.com
Content-Type: text/plain; charset=us-ascii
Message-ID: <42B06322.77DD6 648@nospam_boei ng.com>
Sender: nn**@news.boein g.com (Boeing NNTP News Access)
Content-Transfer-Encoding: 7bit
Organization: Boeing
X-Accept-Language: en
References: <11************ **********@f14g 2000cwb.googleg roups.com>
Mime-Version: 1.0
Date: Wed, 15 Jun 2005 17:19:30 GMT
X-Mailer: Mozilla 4.79 [en]C-CCK-MCD Boeing Kit (Windows NT 5.0; U) gm********@yaho o.com wrote: I need assistance coming up with a clean way to handle filename extensions with my application.
While I can come up with several ways of doing so on my own, I felt perhaps it would be worth asking here to see what more effective or accepted methods for doing would be presented.
The issue is this. My application accepts files names, intended for a cross platform unix and windows environment, from the command line. So the application may get a file name '/home/joe/myExample.ct', 'C:\Work\myExam ple.ct' or more generically 'myExample.ct' My application is to convert the data in the .ct file, into something new, then enter the data into a file in the local directory the application was executed named 'myExample.out' .
Is their a simplified way to handle this problem?
Tony
problem? What problem?
FILE *fin, *fout;
char *inputfile = argv[1]; /* for example */
char *outputfile = "myExample.out" ;
fin = fopen( inputfile, "r" );
/* don't forget to test for success */
fout = fopen( outputfile, "w" );
/* ditto on success check */
/* now read from fin, process, and write to fout */
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Common User Interface Services
M/S 2R-94 (206)544-5225 zh********@hotm ail.com wrote: Following warnings are found in my application:
.../adm_std_mo_desc r.h:240: warning: non-static const member `const struct std_tee_t std_mo::tee' in class without a constructor .../adm_std_mo_desc r.h:244: warning: non-static const member `const char *const std_mo::name' in class without a constructor
comp.lang.c++ is down the hall on the right. The C language does
not have those things.
--
"If you want to post a followup via groups.google.c om, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
Thanks everybody. I finally found that option "-x c++" is among the
options used in gcc. That explains it.
Evan
CBFalconer wrote: zh********@hotm ail.com wrote: Following warnings are found in my application:
.../adm_std_mo_desc r.h:240: warning: non-static const member `const struct std_tee_t std_mo::tee' in class without a constructor .../adm_std_mo_desc r.h:244: warning: non-static const member `const char *const std_mo::name' in class without a constructor
comp.lang.c++ is down the hall on the right. The C language does not have those things.
-- "If you want to post a followup via groups.google.c om, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson
Le 16/06/2005 17:43, dans 11************* *********@o13g2 00...legr oups.com,
«*zh********@ho tmail.com*» <zh********@hot mail.com> a écrit*: Thanks everybody. I finally found that option "-x c++" is among the options used in gcc. That explains it.
A new kind of bug: the compiler option bug :-) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Chefry |
last post by:
I'm trying to set up an off the shelf script and keep getting an error.
My host set up the mysql on my site and I changed the variables I had to in the
settings.php file but I keep getting the following errors
Warning: mysql_pconnect(): Access denied for user: 'ODBC@localhost' (Using password: NO)
in...
|
by: Daniel Sjöblom |
last post by:
When I compile this (with GCC and optimizations on):
void foo(void)
{
int a;
float f = *((float *) &a);
}
I get the warning : "dereferencing type-punned pointer will break
strict-aliasing rules". Does this mean that f and a can be stored in the
|
by: Anitha |
last post by:
Hi
I observed something while coding the other day:
if I declare a character array as char s, and try to use it as any
other character array..it works perfectly fine most of the times. It
holds strings of any length. I guess what is happening here is that
this array initially holds only '\0' and hence is of length 1.
But sometimes,...
|
by: Dave Hansen |
last post by:
Please note crosspost.
Often when writing code requiring function pointers, it is necessary
to write functions that ignore their formal parameters. For example,
a state machine function might take a status input, but a certain
error-handling state might ignore it:
typedef void (*State_Fn)(uint8_t);
void error_state(uint8_t status)
|
by: Hatim Ali |
last post by:
Hello folks,
I've integrated my ASP.NET website with a portal on web. My website opens in
a frame provided by the web portal. The portal uses https protocol. Now when
i open my website IE displays a security warning saying "This page contains
both secure and un-secure items. Do you want to display the non secure
items". When i hit yes every...
| |
by: sulays |
last post by:
I need to insert and sort in a link list
|
by: Rich Sienkiewicz |
last post by:
The C# compiler gives warnings about unused variables. I thin it needs a
warning about an unassigned reference. For instance, this compiles without
any warnings/errors, but of course blows up when run:
SqlConnection cnn = null;
try
{
new SqlConnection(myConnectionString);
cnn.Open()
|
by: shadab |
last post by:
I am having big problem retrieving data assgined to dynamic 2-d array .
i am calculating and saving data in to dynamic 2-d array.
but when i retrieve them, it doesnt give correct values.
you can run following code in C compiler and see the difference
follwoing is my code, please have a look and please reply to
sanwa001@fiu.edu
|
by: Heinrich Pumpernickel |
last post by:
what does this warning mean ?
#include <stdio.h>
int main()
{
long l = 100;
printf("l is %li\n", l * 10L);
|
by: @$|-|. DUBEY |
last post by:
i have a interger
val = 99999;
and i want to add the content of val i.e., 9+9+9+9+9 = 45;
how to do that....
need urgent help
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |