Jim: Please forgive me if I am being impractical here, but perhaps I'm
missing something. From your post it seems that you could reduce the size
of your main program by using an external function or module that does
case-insensitive string comparisons. A cycle-count purist would object to
the exercise of the call stack but in practice you would not see a
perceptible change in speed for the user.
Another red flag is that you are putting everything in main(), a practice
that has been discouraged in every computer science primer that I have seen
because of maintainability. You have most of a 10,000 LOC application in a
single main module. My personal solution when I find any module getting two
big is to block it out in separate functions or operations, then break out
those as procedures or modules and replace my big module with a list of
calls and loops so that its function becomes control, with most or all
processing moved out to called procedures or modules. From your short
description of the code, one possibility is breaking out each set of
switches as a separate module.
James K Beard
From: Jim Michaels [mailto:[email protected]]
Sent: Monday, March 28, 2011 1:26 AM
To: [email protected]
Subject: Re: [Mingw-w64-public] sezero 4.5.2 1002 note: variable tracking
size limit exceeded with -fvar-tracking-assignments, retrying without
if it helps any, this means "out of memory". the code is 10,000 loc (lines
of code) and main is about probably 7000 lines worth of switches and lots of
strings.
I really don't know how to code this without using a huge main(). the code
is different for each if statement, there are between 4-40 string
comparisons each, and class manipulations.
Just ask and I can attach the code or post a URL to it with a build system
in place.
it's the file phonelist.cpp and guibackend.cpp, neither one will compile and
they ar3e both similar in this respect.
I am forced to use a WinMain() because they use DLL's, so I think I have to
use the -mwindows switch.
I am unable to use the sezero 4.5.2 1002 personal build. I don't know what
build I can use, I may just try the TDM just to see if it makes any
difference (doesn't sound like it, because the problem I am running into has
nothing to do with inlines, I have no inlines in that code).
I would greatly appreciate any help someone could give me. this code used
to build until I added20-30 new fields, and thus a at least 4-6x more new
switches.
the code would be GREATLY reduced if Bjarne Stroustrup (or someone) would
fix the Standard C++ Library (STL) to include a case-insensitive set of
compares for the string template (#include <string>). If someone could do
that with gcc or especially with the standard I think everyone would be
really happy. it would reduce coding by about 6x and reduce code breakage.
because right now, my code won't compile due to sheer size I think.
My System (I hope to upgrade soon to 24GB RAM System which I desperately
need):
XP Pro Sp3 32-bit, 3GB RAM, 2TB hard disk
C:\prj\phonelist\pg-phonelist-3.3>\u\df -a
*C:-----------------*********************** 1.18TB/ 2.00TB (59.14%)
TOT:-----------------*********************** 1.18TB/ 2.00TB (59.14%)
TOT USED: ------------------------**************** 817.44GB/ 2.00TB
(40.86%)
C:\prj\phonelist\pg-phonelist-3.3>
_____
From: Jim Michaels <[email protected]>
To: mingw64 <[email protected]>
Sent: Fri, March 25, 2011 9:57:40 PM
Subject: [Mingw-w64-public] sezero 4.5.2 1002 note: variable tracking size
limit exceeded with -fvar-tracking-assignments, retrying without
C:\prj\phonelist\pg-phonelist-3.3>rem
c:\mingw-w32-bin_i686-mingw_20101002_4.5_sezero\mingw32\bin\g++.exe -Wall -W
-O -mwindows -g -static-libgcc -isystem /l
ibpq/ -isystem /libpq/server/libpq/ -isystem /prj/fltk/fltk-1.1.10/ -isystem
/prj/fltk/fltk-1.1.10/lib/ -isystem /prj/zlib-1.2.5/
-I/libpq/;/libpq/server/libpq/
;/prj/fltk/fltk-1.1.10/;/prj/zlib-1.2.5/
-L/libpq/;/libpq/server/libpq/;/prj/fltk/fltk-1.1.10/lib/;/prj/zlib-1.2.5/
-std=c++0x -o phonelist.exe phonelist.cpp s
tring2.cpp atoi64.cpp
phonelist.manifest.res
c:\mingw-w32-bin_i686-mingw_20101002_4.5_sezero\mingw32\lib\gcc\i686-w64-min
gw32\4.5.2\libgcc.a
c:\mingw-w32-bin_i686-mingw_20101002_4.5_sezero\mingw32\lib32\li
bstdc++.a 2> errgw
C:\prj\phonelist\pg-phonelist-3.3>c:\mingw-w32-bin_i686-mingw_20101002_4.5_s
ezero\mingw32\bin\g++.exe -Wall -W -O -mwindows -g -static-libgcc
-isystem /libpq
/ -isystem /libpq/server/libpq/ -isystem /prj/fltk/fltk-1.1.10/ -isystem
/prj/fltk/fltk-1.1.10/lib/ -isystem /prj/zlib-1.2.5/ -std=c++0x -o
phonelist.exe phone
list.cpp string2.cpp atoi64.cpp
phonelist.man
ifest.res
c:\mingw-w32-bin_i686-mingw_20101002_4.5_sezero\mingw32\lib\gcc\i686-w64-min
gw32\4.5.2\libgcc.a c:\mingw-w32-bin_i686-mingw_20101002_4.5_sezero\mingw3
2\lib32\libstdc++.a 2>errgw
C:\prj\phonelist\pg-phonelist-3.3>type errgw
phonelist.cpp: In function 'bool do_insert(CRecord&)':
phonelist.cpp:1927:28: warning: unused variable 'st'
phonelist.cpp:1928:17: warning: unused variable 'ntuples'
phonelist.cpp:1930:17: warning: unused variable 'index'
phonelist.cpp:1931:18: warning: unused variable 'isNotGlobal'
phonelist.cpp: In function 'bool do_search(CRecord&)':
phonelist.cpp:2927:28: warning: unused variable 'st'
phonelist.cpp: In function 'bool do_importcsv()':
phonelist.cpp:3369:28: warning: unused variable 'st'
phonelist.cpp:3370:17: warning: unused variable 'ntuples'
phonelist.cpp:3372:17: warning: unused variable 'index'
phonelist.cpp: In function 'bool do_exportcsv(CRecord&)':
phonelist.cpp:4182:22: warning: statement has no effect
phonelist.cpp:4045:28: warning: unused variable 'st'
phonelist.cpp: In function 'bool do_exportxml(CRecord&)':
phonelist.cpp:4755:28: warning: unused variable 'st'
phonelist.cpp: In function 'bool do_importtxt()':
phonelist.cpp:5469:28: warning: unused variable 'st'
phonelist.cpp:5470:17: warning: unused variable 'ntuples'
phonelist.cpp:5472:17: warning: unused variable 'index'
phonelist.cpp:5475:18: warning: unused variable 'isNotGlobal'
phonelist.cpp: In function 'bool do_exporttxt(CRecord&)':
phonelist.cpp:6413:28: warning: unused variable 'st'
phonelist.cpp: In function 'void ParseCommandLine(CHAR*, int&,
std::vector<std::basic_string<char> >&)':
phonelist.cpp:7066:35: warning: comparison between signed and unsigned
integer expressions
phonelist.cpp: In function 'int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*,
int)':
phonelist.cpp:7112:9: warning: unused variable 'eindex'
phonelist.cpp: At global scope:
phonelist.cpp:7102:12: warning: unused parameter 'hInstance'
phonelist.cpp:7102:12: warning: unused parameter 'hPrevInstance'
phonelist.cpp:7102:12: warning: unused parameter 'nCmdShow'
phonelist.cpp: In function 'int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*,
int)':
phonelist.cpp:7102:12: note: variable tracking size limit exceeded with
-fvar-tracking-assignments, retrying without
string2.cpp: In function 'int _strnicmp(char*, char*, int)':
string2.cpp:69:12: warning: unused variable 'ch1'
string2.cpp:69:17: warning: unused variable 'ch2'
atoi64.cpp: In function 'uint64_t atou64_(const char*)':
atoi64.cpp:758:33: warning: comparison between signed and unsigned integer
expressions
atoi64.cpp:772:33: warning: comparison between signed and unsigned integer
expressions
atoi64.cpp:786:33: warning: comparison between signed and unsigned integer
expressions
atoi64.cpp:800:33: warning: comparison between signed and unsigned integer
expressions
C:\prj\phonelist\pg-phonelist-3.3>dir phonelist.exe
Volume in drive C is samsung 2000
Volume Serial Number is 783C-0FA9
Directory of C:\prj\phonelist\pg-phonelist-3.3
03/25/2011 09:47 PM 1,584,660 phonelist.exe
6 File(s) 237,991,942 bytes
0 Dir(s) 1,173,900,255,232 bytes free
C:\prj\phonelist\pg-phonelist-3.3>
-------------
Jim Michaels
[email protected]
[email protected]
http://JimsComputerRepairandWebDesign.com
http://JesusnJim.com (my personal site, has software)
http://DoLifeComputers.JesusnJim.com (group which I lead)
---
Computer memory/disk size measurements:
[KB KiB] [MB MiB] [GB GiB] [TB TiB]
[10^3B=1,000B=1KB][2^10B=1,024B=1KiB]
[10^6B=1,000,000B=1MB][2^20B=1,048,576B=1MiB]
[10^9B=1,000,000,000B=1GB][2^30B=1,073,741,824B=1GiB]
[10^12B=1,000,000,000,000B=1TB][2^40B=1,099,511,627,776B=1TiB]
Note: disk size is measured in MB, GB, or TB, not in MiB, GiB, or TiB.
computer memory (RAM) is measured in MiB and GiB.
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public