|
Why not? It works for the most part. From what I have determined, this may be a bug in the 4.8.1 GCC release, as 4.8.0 seems to work correctly.
Gryphons Are Awesome! Gryphons Are Awesome!
|
|
|
|
|
Brisingr Aerowing wrote: may be a bug
Hope so it might be? 
|
|
|
|
|
Be sure to tell both the compiler and the linker that you are making a 32 bit app (-m32).
Also, 64 bit gdb does not work with 32 bit programs as it will load systems libraries from the 64-bit directory instead of system32 (cause Windows redirects 64-bit programs away from 32-bit binaries should be). The error message suggest that there is a way, but I never worked out the details of it.
EDIT:
Also, if you have made sure both of the above are not the issue, then it is likely you have a 64-bit version of a dll your program links against in the search path. This is solved by using static linking or dropping the 32-bit version in the same directory as the application.
Specifically, I would imagine that the mingw-64 compiler is on your PATH, and it will have the 64-bit versions of many of the dlls it links your programs against in the same folder as the compiler since it uses them.
modified 9-Jun-13 0:42am.
|
|
|
|
|
Nope, only the 32 bit is. And I did not know about the -m32 switch. Oh, well. Thanks!
Me.Fail(Fail.Epic)
(NOTE: I only used VB for the Me keyword!)
Gryphons Are Awesome! Gryphons Are Awesome!
|
|
|
|
|
Okay, so the team I'm working with has decided to go all process and that. Don't get me wrong, they are a good team, I just have reservations about having perfect source code and no product. They were set loose to derive a document for coding - 60+ pages later, I am afraid.
Any recommendations for reasonably affordable tools that could be set up to cull the drudge work? Still searching - sort of - I've been working on code.
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
I'd advise against doing this kind of thing. In my last job, we did much the same thing. Instead of being a mechanism for better code, the coding standards/coding guidelines document became a weapon that several members used to beat other people over the head with. It was not pretty. I was one of the document authors and regrettably saw it go wrong before my very eyes. I regretted participation in the group.
What I was in the process of doing when I left the group was attempt to set up a code formatter in the VCS system such that code would be checked in without modification, but would be run through a formatter when a checkout occurred. Use of a switch would skip the reformat. This would resolve format issues but not things like required comments etc. I left the company before it was complete; not sure how it turned out.
--
Harvey
|
|
|
|
|
I'm running under the motto "Happy to help, what would you like me to do?"
The entire process has taken on a life of it's own.
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
charlieg wrote: ny recommendations for reasonably affordable tools
The only ones required IMO are common sense and a good peer review system. We tried writing up a doc and enforcing certain rules and simple as they were, it just got in the way and slowed down productivity. My colleague and I have dissimilar coding styles, but at the basic, we understand that each other may have to maintain and enhance one another's code. Thus we ensure that our code is readable, well formatted and decently commented. We also follow a review system where a peer will go over the code and check for bugs, quality and performance. We also switch reviewers around so that everyone gets fair game. The team also uses resharper, which makes some useful suggestions about code format and style.
SG
Aham Brahmasmi!
|
|
|
|
|
charlieg wrote: Any recommendations for reasonably affordable tools that could be set up to cull the drudge work? Still searching - sort of - I've been working on code.
A Strict NO! This will be draconian and will have a lot of adverse effects appearing in the long turn...
|
|
|
|
|
These end up becoming a choke point for the project. Don't do it.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
Those who seek perfection will only find imperfection
nils illegitimus carborundum
me, me, me
me, in pictures
|
|
|
|
|
It's actually worse than I made it out to be.
The team is VERY experienced. Almost guaranteed to result in friction.
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
It usually only works when the team is young, stupid and malleable.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
Those who seek perfection will only find imperfection
nils illegitimus carborundum
me, me, me
me, in pictures
|
|
|
|
|
If your coding standards document is longer than a page or two, you're doing it wrong. Our standards document is a 1.5 pages, including samples. We've used it for over ten years, developed a half dozen products, and built a body of several million lines of code. All of this from a group that has ranged from four to ten people over the period.
Software Zen: delete this;
|
|
|
|
|
Maybe someone will blunder across this thread...
The thing is that I have to play the hand I'm dealt. Nobody, I mean nobody is challenging anything being said.
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Unless this opus is documenting and codifying existing practice, this does not bode well. If this is being imposed by management, I'd advocate polishing your resume and getting out.
I was in this situation a few years ago. We were placed under a hardware engineer who didn't understand software development, didn't like it, and thought he could convert our process into a "turn-the-crank" operation through a bunch of lean practices garbage he'd picked up in some book. Needless to say, it was a disaster. In a rare moment of clarity, someone high up figured out this was A Bad Idea and we were moved elsewhere in the org chart.
Software Zen: delete this;
|
|
|
|
|
The only really effective method involves whips and chains (metaphorically), and lots of pain (not so metaphorically).
A better way to go involves questions like "Hey, Steve, are you saying that if Geoff puts his braces on a new line, you can't understand the code?", and mentioning that more advanced developers, several of which are available for hire, might not have that problem.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Have you tried a baseball bat? The use of this tool quickly makes people adhere to standards.
If that fails, try lobotomies.
Your BF quote in you signature block:
charlieg wrote: They who can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety
is a fair summary of what adherence to arbitrarily derived guidelines is about - giving up liberty to obtain a little temporary safety. If we had adhered to guidelines, all of our code would still be daubs of blood and plant extracts on cave walls. People need freedom to experiment and to advance. That is how progress takes place.
|
|
|
|
|
Not arguing, but I'm the mercenary here....
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
I've used the baseball bat approach. (No really I have) and it worked well for about a month. Even within that month I saw the slip back to old habits. You cannot force people to write good code.
Tanks for your support
Pat O
<a href="http://currentchaos.blogspot.com/">Blog</a>
_ _ _
|
|
|
|
|
It all depends on what you want to enforce, and also to some degreen on your programming language(s).
I am responsible for a medium size project (an internal tool) written in C# in VS, that is being updated by about half a dozen people who develop their own extensions, but before they are released to others, I look through it. "Unfortunately" I have a tendency to delete the final closing brace, so I have to type it in again. And then, unfortunately, the code layout is automatically adjusted to the style I have set up.
When Visual Studio reformats the code, it happens that end-of-line comments (that I am very fond of myself) need a little straightening up to make a nice, straight column. But if somebody comments on the reformatting, I put up a really sad face, "I am sorry, that happened automatically when I looked through your code..." (it didn't take them long to learn, though).
We also have an SVN precommit-hook verifying that no source file contains any tab characters, and our build scripts always run lint on C code (which is used in several other projects). For C# we don't have lint, but when I review added/updated code, I always compile it, and expect it to compile with no errors and no warnings. If they do occur, and I cannot easily fix it there on the spot, I return the code to the developer.
Obviously this doesn't handle naming conventions and stuff like that. When I review the code, it happens that I use the F2 key, Refactor/Rename, e.g. to change use of underscores to CamelCase (or PascalCase). More extensive things, like comment blocks explaining the purpose and structure of a module. But don't expect a tool to be able to do much more than I can do when reviewing the code (i.e. telling the developer to add what is missing).
Actually, once the code layout questions are settled (through VS reformatting), the fierce arguments over coding guidelines tend to calm down so much that it is possible to have a civilized discussion about good naming principles etc.
Bottom line: You can get a whole lot "for free" (almost), at least if you happen to be using VS, and in particular with C#.
|
|
|
|
|
We also have an SVN precommit-hook verifying that no source file contains any tab characters, and our build scripts always run lint on C code (which is used in several other projects).
That is a great idea. We're mainly a C/C++ shop with some C# tossed in. I'll have to look into that.
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
|
See Kodak Motivational Carrot[^] lower on the page.
Psychosis at 10
Film at 11
Those who do not remember the past, are doomed to repeat it.
Those who do not remember the past, cannot build upon it.
|
|
|
|
|
Code Sniffer is what you likely want to search for - PHP has a great one.
The premise is simple, use a tokenizer, and the write custom rules for what is valid according to convention. No external documents necessary, the CS files act as pre-compile tests.
An additional bonus, is the ability to hook this into VCS (ie: Subversion) in pre-phase and stop code from every making it into the repo until it passes convention tests and automated verification.
It's more work than I leading on, but well worth the pay off in the end, if quality is important to you.
Alex
|
|
|
|
|
Depends on the language. For C#, ReSharper will flag guideline violations and let you reformat code. The team I'm on has already agreed on some basic guidelines for consistency sake (how to name data members is the single biggest argument point.) In places where we can't comply without great pain (some serialized classes) we add "Resharper ignore this" comments.
I've been fortunate in that my previous three team leads and most the team had a similar enough coding style with one glaring exception (one guy had the weirdest indentation style and a near obsession with nested if statements) that our style was "whatever we're already doing." The code I'm working on now has been touched by so many developers with different styles that it's a formatted mess. This has a definite negative impact on productivity.
|
|
|
|
|