Post #441,244
3/29/22 10:46:20 AM
3/29/22 10:46:20 AM
|
Well obviously anyone trying to build apps would know to do that, duh!
|
Post #441,245
3/29/22 10:52:14 AM
3/29/22 10:52:24 AM
|
Here's one of the error messages
I will give you a shiny nickel if you can guess how this was resolved in its entirety. src/option.cc: In constructor ‘Option::Option(std::vector >::const_iterator&, const const_iterator&, bool)’: src/option.cc:41:32: error: cannot convert ‘std::__cxx11::basic_string::iterator’ {aka ‘__gnu_cxx::__normal_iterator >’} to ‘const char*’ 41 | _key.erase( remove(_key.begin(),_key.end(),'-'), _key.end() ); | ~~~~~~~~~~^~ | | | std::__cxx11::basic_string::iterator {aka __gnu_cxx::__normal_iterator >} In file included from /usr/include/c++/9/cstdio:42, from /usr/include/c++/9/ext/string_conversions.h:43, from /usr/include/c++/9/bits/basic_string.h:6496, from /usr/include/c++/9/string:55, from src/types.h:6, from src/option.h:4, from src/option.cc:1: /usr/include/stdio.h:146:32: note: initializing argument 1 of ‘int remove(const char*)’ 146 | extern int remove (const char *__filename) __THROW;
| ~~~~~~~~~~~~^~~~~~~~~~ src/option.cc:42:32: error: cannot convert ‘std::__cxx11::basic_string::iterator’ {aka ‘__gnu_cxx::__normal_iterator >’} to ‘const char*’ 42 | _key.erase( remove(_key.begin(),_key.end(),'_'), _key.end() ); | ~~~~~~~~~~^~ | | | std::__cxx11::basic_string::iterator {aka __gnu_cxx::__normal_iterator >} In file included from /usr/include/c++/9/cstdio:42, from /usr/include/c++/9/ext/string_conversions.h:43, from /usr/include/c++/9/bits/basic_string.h:6496, from /usr/include/c++/9/string:55, from src/types.h:6, from src/option.h:4, from src/option.cc:1: /usr/include/stdio.h:146:32: note: initializing argument 1 of ‘int remove(const char*)’ 146 | extern int remove (const char *__filename) __THROW; | ~~~~~~~~~~~~^~~~~~~~~~
Edited by pwhysall
March 29, 2022, 10:52:24 AM EDT
|
Post #441,246
3/29/22 11:39:28 AM
3/29/22 11:39:28 AM
|
mix of gcc and cc usage?
"Science is the belief in the ignorance of the experts" – Richard Feynman
|
Post #441,247
3/29/22 1:44:45 PM
3/29/22 1:44:45 PM
|
Nope
|
Post #441,250
3/29/22 10:15:14 PM
3/29/22 10:15:14 PM
|
I assume it's related to sizes of various things changing as memory spaces got bigger.
Let's see... https://github.com/mikemayer67/xbattle/blob/master/READMEREVISION NOTES
This is version 6.0.1 of xbattle, by Mike Mayer, based on the version 5.4.1 by Greg Lesher. Much has changed in software developement since this game was released in 1991. Unfortunatey, this has made xbattle uncompilable on many platforms. This is a rewrite of 5.4.1 in C++11. As with the original, it requires the X11 library (and headers). Unlike the original, it also requires STL (the standard template library).
[...]
BUG FIXES
On some machines the "char" type is assumed signed, while on others it is assumed unsigned. A new typedef for signed and unsigned char types has been created.
[...] Something like that? Have fun! Cheers, Scott.
|
Post #441,251
3/30/22 12:58:39 AM
3/30/22 12:58:39 AM
|
Nope :)
|
Post #441,258
3/31/22 12:28:09 AM
3/31/22 12:28:33 AM
|
Well, the answer was obvious
The offending file required:
<code>#include <cstring></code>
Because that’s definitely what the error message said.
Edited by pwhysall
March 31, 2022, 12:28:33 AM EDT
|
Post #441,285
4/4/22 4:38:58 AM
4/4/22 4:38:58 AM
|
Oh dear.
That's the same disease Java has: it tells you what broke but not how or where to fix it. Same thing turned me off Scala, too.
Wade.
|
Post #441,294
4/5/22 11:08:46 AM
4/5/22 11:08:46 AM
|
One thing I love about Rust...
The error messages are mostly coherent and self-explanatory.
Ceterum autem censeo pars Republican esse delendam.
|
Post #441,297
4/5/22 11:28:45 AM
4/5/22 11:28:45 AM
|
I miss the generic PCC messages
Somewhere in this file you f***** up. I'm not going to tell you where. Go figure it out.
One of my proudest moments in my youth was when I caused the AT&t C compiler to fail. I'd spent the previous 6 months being kicked out of my boss's cubicle, every time I complained. Read the f****** manual. Go back and do it again. But Brian, this is real. There is a problem with the compiler. And then he called his buddies at AT&t.
They agreed and fixed it.
|
Post #441,298
4/5/22 11:33:34 AM
4/5/22 5:24:35 PM
|
On the other hand, it was part of a 30-page case statement
There was a command line interface into an editorial program. When the compiler told me my code was too complex for it to figure it out, I knew I crossed a threshold. I was doing this wrong. That was an education.
Edit:
But I just conflated two stories. So let me clarify. Whatever triggered Brian to call AT&t for me was not part of some insane large case statement. I just had a bit of code that caused a compiler failure that should not have. But since I had just spent the previous couple of months learning the language and I thought everything was my problem. I spent a lot of time examining coredumps trying to figure out why my code was getting a memory fault. And I finally figured out it was the compiler generating bad code as opposed to my code doing it. The insane large case statement came about 2 years later. Sorry about that.
Edited by crazy
April 5, 2022, 05:24:35 PM EDT
|
Post #441,300
4/5/22 12:43:57 PM
4/5/22 12:43:57 PM
|
Didn't you have anyone doing code review?
I'd have been confused after the first page, curious by the second, laughing by the third. "OK, that's a good one! Now show me the real code ... It is? ... But why did ... Right, have a seat."
|
Post #441,302
4/5/22 4:37:25 PM
4/5/22 5:18:10 PM
|
Code review? I was the ultimate cowboy coder in those days.
The first year I taught myself Sperry univac mainframe BASIC. I just started typing. This was at a 6-month techie school. I tested out of the basic course and then used basic to generate assembler and Cobol code. I wasn't going to type all that s*** in. I even hired a classmate to type for me occasionally.
But I missed the concept of arrays. So I came up with self-modifying basic code to accomplish the same task that arrays handle, with my variable names having ever incrementing numbers tacked onto them.
Sure, I accomplished some incredible crazy things. And then one of my classmates pointed out the concept of arrays to me. Holy s***! If I missed that, what else did I miss?
So then I learned to read the books. Read the manuals. Joined ACM. Get a couple books a month. Then I worked for a book shop and I got paid in books. Read the programmer guides. Just because I can figure out a way to accomplish a task does not mean it can't be done a lot better. Stand on the shoulders of giants, don't pretend to be one.
A year later I'm running through the xenix tutorials on a Tandy 6000. Teaching myself C. In a tiny company with two competent programmers, two support people, one salesperson, one owner. Those competent programmers had no time for me.
Code review? I don't think it was in the books yet. They just came up with the concept of structured programming at that point. Spaghetti Fortran was the norm. Goto wasn't evil yet.
And self-modifying code was admired.
3 years later I was the only programmer in an office of 30 people. The only tech guy. The only administrator.
I had no experience with any SQL based database. At that point I had done btreive via C and a couple of crap off the shelf dbase systems. And I was tasked with reworking a company. Figure out the database to start off with. Ingress, IBM ( I have thankfully forgotten what that database name is, I can Google query it but it's not worth the trauma) f*** it just came back, DB2, informix, a couple others. Oracle was the one I chose. I had absolutely no background to be making these levels of decisions at that point in my life. I think I was 22 or 23.
I initially negotiated $6,000 for Oracle license plus yearly support. They told me I did not need to actually make the deal at the moment, just be sure I wanted to use it and then make the deal. Take your time. Code a bit. Make sure it works for you.
I was foolish enough to try to build the system via SQL-Forms. I had to construct table driven editorial forms. About two or three hundred of them. So I was going to do it via self-modifying SQL forms. I was an idiot. And I was locking myself into Oracle at that moment. So then I rethought and decided I was going to code it all by hand in C.
I coded for 2 months. I coded for vax VMS, Unix/Xenix, and MS-DOS 3. I had never used a vax before, but since I worked for ziff Davis and they had spare vaxen lying around, it was a possible target. So I coded portably for all of these for both the database access and the screen driving portion. My code could compile on any and when we had system specific interfaces such as the screen it kept everything indirect and drew it all appropriately no matter what system.
I learn to login and run programs on the vax and glance at the help system and compile my code and occasionally edit my code. I learned to use the vax full screen editor and I have to tell you it sucks. It's brilliant though. If I had started with that editor I would probably love it but my default vi fingers do not work with VAX TPU.
As I was doing this I was also learning Oracle. In those days every time you called Oracle tech support and they sent you anything, They also sent you the entire manual set that spanned two boxes and weighed about 80 lb. Every time they sent me anything, they also sent me a manual set. I had them sprinkled around the building.
And when I was ready to pull the trigger Oracle took the price to $20,000 plus the yearly. My boss told me to find an alternative. So I installed a lot of different databases and coded interfaces for each one of them.
When I was done it turns out all the alternative databases wanted the same amount of money as Oracle, they just didn't tell you until you got to that point in negotiation. So I ended up with Oracle.
I wrote a system that included a command line interface into a full screen editorial program. I had to exactly copy the system that was already there and it was horrible. But I had to start with that and then make it better after I moved all the people to it. It took four people ( seasoned professional programmers ) a year to write the system the first time. It took me about 2 months.
I duplicated a Pick system with my hand-coded C/Oracle system. This command line interface had its own macro language. And it was this horrible abortion of working through what that person typed on the command line and figuring out what to do with it. So every possible command or entry of any sort had to be parsed and acted upon. And if it was in the middle of a macro, I was essentially executing an interpreted language and bouncing all over the place. That case statement went on and on and on. Half the time if it matched something, it still need to extract some more stuff and figure out what to do with that and then realize that it was an incorrect direction and then go through the rest of the possibilities in the case statement. I had some serious go-tos in that.
That was when I found out a standard programmer can handle two screens, a printed page. But I could handle about 30 or 40. But it was a bad idea to do it.
Edited by crazy
April 5, 2022, 05:18:10 PM EDT
|
Post #441,303
4/5/22 5:45:21 PM
4/5/22 5:45:21 PM
|
Mel? Is that you?
Ceterum autem censeo pars Republican esse delendam.
|
Post #441,304
4/5/22 5:58:08 PM
4/5/22 5:58:08 PM
|
Oh how I loved Mel
Was it the Royal something typewriter company? And he created the term most pessimism I don't know, it was based on the pessimistic target of the rotating memory drum.
|
Post #441,305
4/5/22 6:15:24 PM
4/5/22 6:58:52 PM
|
I learned to code for others after that job
I tried to explain to the HR person that came in to prep for my exit from that job. I wore about six different hats.
You need a programmer, a system administrator, a database administrator, a technical manager, a help desk person and the programmer better know C, Perl, all the Unix command line possibilities as they are in shell scripts all over the place, oh, and this is a new multiprocessor Unix system that is way new cheap desktop technology and is prone to failure. So you better be able to handle the rolling oracle backup system that I created before Oracle had it. There are 30 users right down the hall from you and will walk into your office to try to distract you. They are all nice people. You have to kick them out nicely. Unless there is a real request to be dealt with. You will never have a moment of free time if you don't know how to manage it. There is a once a month production that goes for three straight days. You better be available the entire time. The system will call you if there is a problem. You better be willing to carry the beeper 24 by 7. And don't expect any support from corporate because they don't know s*** about this system and they told me I was on my own when I created it and my boss was fine with that.
She laughed at me. I knew the end was near when that happened.
My boss fought for this system.
I had a mediocre assistant that had been forced upon me at that point so she was going to be in charge when I left. And she was no programmer and a piss poor junior admin. But there was no smoking guns to fire her. She spent 90% of her time writing her unpublished novel. I was not allowed to fire her.
They closed that division about a year after I left. Either I timed it perfectly or there was technical problems after I left.
After that point I spent a couple years building a system and then hiring and managing other programmers. I kept writing my own systems and handing them off to other programmers.
I spent an enormous amount of time recruiting. I visited classes and user groups and interacted with hundreds of people as I handed out my card and tried to attract the best and the brightest. My best perl programmer was an English major in college. And his last name was Pearl. He was born into it. He was tossed at me via a recruiter and his resume was absolutely no mach for the job. But on interview it was obvious and over the years he amazed me again and again. He was one of many.
I also had my failures. So I became very careful.
Bottom line is I never tried to embed and I always try to hire smarter than me.
So everything I wrote had to be easily understood by any programmer that I was willing to hire. And I didn't code obscure to be fancy. But occasionally you have to do table driven regular expressions in closures and that s*** goes wild.
Edited by crazy
April 5, 2022, 06:32:43 PM EDT
Edited by crazy
April 5, 2022, 06:33:39 PM EDT
Edited by crazy
April 5, 2022, 06:35:59 PM EDT
Edited by crazy
April 5, 2022, 06:58:52 PM EDT
|
Post #441,310
4/6/22 4:22:04 PM
4/6/22 4:22:04 PM
|
Go-tos within a 30-page CASE statement ... [shudder]
|
Post #441,316
4/6/22 9:36:27 PM
4/6/22 9:45:54 PM
|
Not just gotos, I had long jumps
Save the stack. Pray you understand what you did with the local variables. Jump hard. Long jump is the ultimate bail maneuver when you are programming in C.
Even better. I knew which address to jump to to reboot the IBM xt. When I ran out of memory I rebooted the box.
There were many computers at the Monmouth county library. The Monmouth county library had many branches. I wrote a program that replaced their card catalogs. It talked to the main Unix systems and told them what was in stock and checked out. It drew a little ascii map of the library and put a little pointer and floated along from where they were to where the book was that they wanted.
When the library opened there was a ceremony. There was a crowd of people. This crowd of people wandered around the library and used my computers to find books. They s*** themselves. That was a wonderful moment.
But occasionally that program would s*** itself. It would run out of memory. So I jumped to the first thousand bytes and shoved a bit of data in a particular location and rebooted the box. I used to teach C courses and explained how to do this to other programmers. I passed this bit of knowledge and many people rebooted boxes because I told them to.
Edited by crazy
April 6, 2022, 09:45:54 PM EDT
|